[Issue 14406] GIT HEAD ignores forward reference and generates wrong code
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Apr 4 20:20:59 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14406
--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> ---
This is an accepts-invalid bug. Slightly reduced:
class Foo {}
string str_mixin(T)()
{
static if (T.tupleof.length) {} // Fix instance size of T (== Frop)
return "Bar bar_obj; static class Bar { Foo foo; }";
}
class Frop
{
mixin(str_mixin!(typeof(this))); // adding more field after Frop fields
fixed.
}
void main()
{
Frop simple = new Frop;
}
In str_mixin() function, testing Frop.tupleof fix the class fields and instance
size. Therefore adding one more field `bar_obj` should be rejected because it
will change the Frop instance size.
--
More information about the Digitalmars-d-bugs
mailing list