Bug 420 – mixin make dmd break

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-10-09T20:28:00Z
Last change time
2014-02-15T13:20:42Z
Assigned to
bugzilla
Creator
davidl

Comments

Comment #0 by davidl — 2006-10-09T20:28:21Z
import std .stdio ; template MGettor (alias Fld) { typeof(Fld) opCall () { writefln("getter"); return Fld; } } class Foo { int a = 1 , b = 2 ; mixin MGettor!(a) geta; mixin MGettor!(b) getb; } void main () { auto foo = new Foo; writefln(foo.geta); writefln(foo.getb); } error from dmd: parse a semantic a semantic2 a semantic3 a code a generating code for function 'opCall' generating code for function 'opCall' generating code for function 'main' foo dotexp mixin MGettor!(a); Internal error: e2ir.c 772
Comment #1 by braddr — 2006-10-16T03:02:01Z
This is the same internal error as bug 354 which also deals with template usage so it might be a dup. The code samples are similar, though definitly not the same. I reduced the test case a bit: import std.stdio; template MGettor () { void opCall () {} } class Foo { mixin MGettor!() geta; } void main () { Foo foo = new Foo; writefln(foo.geta); }
Comment #2 by bugzilla — 2006-10-18T13:28:12Z
Fixed DMD 0.170