[Issue 9040] New: Assertion `precedence[e->op] != PREC_zero' failed instantiating anonymous class at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 17 08:03:46 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9040

           Summary: Assertion `precedence[e->op] != PREC_zero' failed
                    instantiating anonymous class at compile time
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ogondza at gmail.com


--- Comment #0 from ogondza <ogondza at gmail.com> 2012-11-17 08:03:45 PST ---
An assertion seems to fail when instantiating anonymous class at compile time.

Instantiating non-anonymous class gives meaningful error message.

class BaseClass {}

void main() {

    // OK
    BaseClass instance = new class BaseClass {};

    // Error: cannot evaluate new BaseClass at compile time
    static BaseClass staticInstance = new BaseClass();

    //dmd: expression.c:1276: void expToCBuffer(OutBuffer*, HdrGenState*,
Expression*, PREC): Assertion `precedence[e->op] != PREC_zero' failed.
    //Aborted
    static BaseClass staticAnonInstance = new class BaseClass {};
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list