420 – mixin make dmd break

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 420 - mixin make dmd break
Summary: mixin make dmd break
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2006年10月09日 20:28 UTC by david
Modified: 2014年02月15日 13:20 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description david 2006年10月09日 20:28:21 UTC
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 Brad Roberts 2006年10月16日 03:02:01 UTC
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 Walter Bright 2006年10月18日 13:28:12 UTC
Fixed DMD 0.170


AltStyle によって変換されたページ (->オリジナル) /