www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd 2.054 segfaults

reply d coder <dlang.coder gmail.com> writes:
--485b3970d6a623dd0704a7e1ddca
Content-Type: text/plain; charset=ISO-8859-1

Here is a reduced test case. Before filing a bug report, just wanted to make
sure if I am doing something obviously wrong here.

import std.stdio;
struct Foo(IF, size_t N) { }
interface Bar { }
void main() {
  void printFoo(T: Foo!(IF, N), IF, size_t N)(T foo)
    if(is(IF == interface)) {
    writeln("Type: ", T.stringof);
  }
  Foo!(Bar, 1) foo;
  printFoo(foo);
}

--485b3970d6a623dd0704a7e1ddca
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>Here is a reduced test case. Before filing a bug report, just wanted t=
o make sure if I am doing something obviously wrong here.</div><div><br></d=
iv><div>import std.stdio;</div><div>struct Foo(IF, size_t N) { }</div><div>

interface Bar { }</div><div>void main() {</div><div>=A0 void printFoo(T: Fo=
o!(IF, N), IF, size_t N)(T foo)</div><div>=A0 =A0 if(is(IF =3D=3D interface=
)) {</div><div>=A0 =A0 writeln(&quot;Type: &quot;, T.stringof);</div><div>=
=A0 }</div><div>

=A0 Foo!(Bar, 1) foo;</div><div>=A0 printFoo(foo);</div><div>}</div><div><b=
r></div>

--485b3970d6a623dd0704a7e1ddca--
Jul 12 2011
parent KennyTM~ <kennytm gmail.com> writes:
On Jul 13, 11 00:33, d coder wrote:
 import std.stdio;
 struct Foo(IF, size_t N) { }
 interface Bar { }
 void main() {
    void printFoo(T: Foo!(IF, N), IF, size_t N)(T foo)
      if(is(IF == interface)) {
      writeln("Type: ", T.stringof);
    }
    Foo!(Bar, 1) foo;
    printFoo(foo);
 }

Seems to be my fault :|. Please file a bugzilla anyway. The compiler should not segfault whether you're doing right or wrong.
Jul 12 2011