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: nob...@puremagic.com
        ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@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: -------

Reply via email to