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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from ogondza <[email protected]> 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: -------