digitalmars.D.bugs - [Issue 4678] New: Built struct is callable without opCall
- d-bugmail puremagic.com (32/32) Aug 19 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4678
- d-bugmail puremagic.com (7/7) Jun 26 2011 http://d.puremagic.com/issues/show_bug.cgi?id=4678
- d-bugmail puremagic.com (11/11) May 30 2012 http://d.puremagic.com/issues/show_bug.cgi?id=4678
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: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc 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: -------
Aug 19 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4678 I think there is a pull request with a patch for this bug, do you know what one? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 26 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4678 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE *** This issue has been marked as a duplicate of issue 6036 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 30 2012