← Back to index
|
Original Bugzilla link
Bug 10610 – interpret.c:4067 Assertion Failure
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-11T05:16:00Z
Last change time
2013-08-22T20:45:34Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
r.97all
Comments
Comment #0
by r.97all — 2013-07-11T05:16:57Z
The code cause compiler crash. ----- /d731/f346.d(21): Error: constructor f346.Polynomial!(int).Polynomial.this (int[] coefs) is not callable using argument types () /d731/f346.d(21): Error: cannot implicitly convert expression (Polynomial(null)) of type f346.Polynomial!(int).Polynomial to immutable(Polynomial) /d731/f346.d(6): Error: template instance f346.Polynomial!(int) error instantiating dmd: interpret.c:4067: virtual Expression* CallExp::interpret(InterState*, CtfeGoal): Assertion `thisval && thisval->op == ((TOK)(TOKMAX+1))' failed. ----- import std.numeric : gcd; import std.algorithm : max; void main() { auto f = new Polynomial!int([1, 2, 3, 2, 1, 0, 0, 1, 1, 1]); f.gcd(f); } class Polynomial(T) // T係数の多項式 { this (T[] coefs) { this._coefs = coefs; } int opCmp(int rhs) immutable { return 1; } static immutable(Polynomial!T) min = new Polynomial!T(); private: T[] _coefs; }
Comment #1
by clugdbug — 2013-08-21T03:00:49Z
Reduced test case: ---------------- class Bug10610(T) { int baz() immutable { return 1; } static immutable(Bug10610!T) min = new Bug10610!T(); } alias T10610 = Bug10610!(int); static if (T10610.min.baz()) { } --- junk.d(6): Error: cannot implicitly convert expression (Bug10610()) of type junk.Bug10610!int.Bug10610 to immutable(Bug10610) junk.d(9): Error: template instance junk.Bug10610!int error instantiating interp : min.baz() dmd: ctfeexpr.c:355: Expression* copyLiteral(Expression*): Assertion `0' failed.
Comment #2
by clugdbug — 2013-08-22T12:45:24Z
https://github.com/D-Programming-Language/dmd/pull/2495
Comment #3
by yebblies — 2013-08-22T20:45:34Z
https://github.com/D-Programming-Language/dmd/commit/a3e447c6f91c48ff9362f6bb609252b0d4d758e8