http://d.puremagic.com/issues/show_bug.cgi?id=4678
Summary: Built struct is callable without opCall Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-08-19 06:19:14 PDT --- This D1 program compiles and runs with DMD 2.048: import std.c.stdio: puts; struct Foo { this(int) { puts("THIS"); } } void main() { auto bar = Foo(10); bar(20); } The output: THIS THIS So the Foo constructor is run two times. I think this is not correct. Foo lacks an opCall, so what I expect is a compile-time error that says that 'bar' is not callable. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------