digitalmars.D.bugs - [Issue 11166] New: Forward reference error when alias of template instance is private
- d-bugmail puremagic.com (41/41) Oct 03 2013 http://d.puremagic.com/issues/show_bug.cgi?id=11166
- d-bugmail puremagic.com (7/8) Oct 03 2013 http://d.puremagic.com/issues/show_bug.cgi?id=11166
http://d.puremagic.com/issues/show_bug.cgi?id=11166 Summary: Forward reference error when alias of template instance is private 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 18:34:03 PDT --- This is a weird one: ----- template Tup(T...) { alias Tup = T; } struct S { enum S a = S(0); enum S b = S(1); this(long value) { } long value; // only triggered when private and a template instance. private alias types = Tup!(a, b); } void main() { } ----- test.d(5): Error: cannot create a struct until its size is determined test.d(6): Error: cannot create a struct until its size is determined Note, there is also the following bug where I've accidentally used an enum instead of an alias in the Tuple definition: template Tup(T...) { enum Tup = T; } Using this with the above test-case causes the same diagnostics, but also crashes DMD (git-head). In 2.063.2 it doesn't crash but instead creates an additional diagnostic: test.d(12): Error: template instance bad1.Tup!(__error, __error) error instantiating -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 03 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11166 18:42:36 PDT ---snipAlso: If you remove the ctor it will compile. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 03 2013