digitalmars.D.bugs - [Issue 6766] New: Forward reference error for default struct/class arguments
- d-bugmail puremagic.com (39/39) Oct 04 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6766
http://d.puremagic.com/issues/show_bug.cgi?id=6766 Summary: Forward reference error for default struct/class arguments Product: D Version: D2 Platform: Other OS/Version: Windows 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> 2011-10-04 09:35:05 PDT --- void test(Bar bar = Bar(1)) { } struct Bar { this(int x) { } } void main() { } Error: more initializers than fields of Bar This also affects structs and classes that have methods with default arguments that call ctors of typeof(this): class Foo { this(int x) { } void test(Foo foo = new Foo(1)) { } } struct Bar { this(int x) { } void test(Bar bar = Bar(1)) { } } void main() {} test.d(4): Error: no constructor for Foo test.d(10): Error: more initializers than fields of Bar -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 04 2011