digitalmars.D.bugs - [Issue 7758] New: Mixin error: No size yet for forward reference
- d-bugmail puremagic.com (56/56) Mar 23 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7758
- d-bugmail puremagic.com (24/24) Aug 28 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7758
http://d.puremagic.com/issues/show_bug.cgi?id=7758 Summary: Mixin error: No size yet for forward reference Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: andrej.mitrovich gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-03-23 21:06:20 PDT --- string Test(alias member)() { return ""; } struct S { int i; mixin(Test!i()); } void main() { } test.d(9): Error: struct test.S no size yet for forward reference test.d(10): called from here: Test() test.d(10): Error: argument to mixin must be a string, not (Test()) If I use a mixin template instead it can work: mixin template Test(alias member) { typeof(member) x; } struct S { int i; mixin Test!i; } void main() { } And yet if I try to use mixin() inside of a mixin template it doesn't work: string test(alias member)() { return ""; } mixin template Test(alias member) { mixin(test!member()); } struct S { int i; mixin Test!i; } void main() { } test.d(10): Error: struct test.S no size yet for forward reference test.d(6): called from here: test() test.d(6): Error: argument to mixin must be a string, not (test()) test.d(12): Error: mixin test.S.Test!(i) error instantiating -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 23 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7758 Ellery Newcomer <ellery-newcomer utulsa.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ellery-newcomer utulsa.edu --- Comment #1 from Ellery Newcomer <ellery-newcomer utulsa.edu> 2012-08-28 16:43:36 PDT --- I got it to trip with mixin templates: dmd code.d xobject.d descrobject.d xobject.d(6): Error: struct xobject.Foo no size yet for forward reference // code.d import xobject; // xobject.d import descrobject; template VAR_HEAD() { } struct Foo { mixin VAR_HEAD!(); } // descrobject.d import xobject; __gshared Foo foo; -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 28 2012