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
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); }
Fixed DMD 0.170
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル