June 08, 2011 [Issue 6123] New: [CTFE] Cannot call a template member method inside delegate/function literal with -inline. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6123 Summary: [CTFE] Cannot call a template member method inside delegate/function literal with -inline. Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: kennytm@gmail.com --- Comment #0 from kennytm@gmail.com 2011-06-08 00:47:55 PDT --- Test case: ------------------------- struct Bug6123(T) { void f() {} // can also trigger if the struct is normal but f is template } static assert({ auto piece = Bug6123!int(); piece.f(); return true; }()); ------------------------- Error: Cannot interpret &this at compile time x.d(8): Error: cannot evaluate delegate bool() { Bug6123!(int) piece = Bug6123(); ref Bug6123!(int) this = piece; , assert(&this,"null this"); return true; } () at compile time x.d(4): Error: static assert (delegate bool() { Bug6123!(int) piece = Bug6123(); ref Bug6123!(int) this = piece; , assert(&this,"null this"); return true; } ()) is not evaluatable at compile time ------------------------- (Why that 'assert' is generated in CTFE anyway?) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 11, 2011 [Issue 6123] [CTFE] Cannot call a template member method inside delegate/function literal with -inline. | ||||
---|---|---|---|---|
| ||||
Posted in reply to kennytm@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=6123 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug@yahoo.com.au Resolution| |FIXED --- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-06-11 06:42:31 PDT --- Fixed by implementing pointers in CTFE. https://github.com/D-Programming-Language/dmd/commit/846aa2683ec63c364e72281c4c655387806558e2 D1 fix: https://github.com/D-Programming-Language/dmd/commit/16c9700caab0bece92212c5e1a52b323258d7633 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation