digitalmars.D.bugs - [Issue 6390] New: [CTFE] Struct constructor fails to call another method
- d-bugmail puremagic.com (38/38) Jul 27 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6390
- d-bugmail puremagic.com (13/13) Jul 28 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6390
http://d.puremagic.com/issues/show_bug.cgi?id=6390 Summary: [CTFE] Struct constructor fails to call another method Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: bugzilla kyllingen.net --- Comment #0 from Lars T. Kyllingstad <bugzilla kyllingen.net> 2011-07-27 08:14:52 PDT --- Test case: struct Foo { int i; void fun() { --i; } this(int a) { i = a; fun(); } } void main() { assert (Foo(2).i == 1); } static assert (Foo(2).i == 1); The above refuses to compile, giving the following error: test.d(19): Error: static assert (2 == 1) is false This is purely a CTFE issue; if the static assert is removed, the assert in main() passes at run time, as it should. It seems the call to fun() is neglected when the struct is constructed at compile time. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 27 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6390 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug yahoo.com.au Resolution| |DUPLICATE --- Comment #1 from Don <clugdbug yahoo.com.au> 2011-07-28 00:04:05 PDT --- Already fixed in git master. *** This issue has been marked as a duplicate of issue 6337 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 28 2011