https://d.puremagic.com/issues/show_bug.cgi?id=12120
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from Kenji Hara <[email protected]> 2014-02-09 17:30:31 PST --- (In reply to comment #0) > Here is the reduced code. > > struct Foo { > this(int) {} > static Foo opCall() { > import std.stdio; > writeln("opCall"); > Foo foo = Foo(0); > return foo; > } > } > > void main() { > Foo foo = Foo(); > } If you define constructors in a struct, the syntax `Type()` should be reserved for default construction. If you want to support both Foo() and Foo(1), you should change the constructor to static Foo opCall(int). -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
