www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10610] New: interpret.c:4067 Assertion Failure

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10610

           Summary: interpret.c:4067 Assertion Failure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: r.97all gmail.com



---
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;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10610




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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10610




https://github.com/D-Programming-Language/dmd/pull/2495

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 22 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10610


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED



https://github.com/D-Programming-Language/dmd/commit/a3e447c6f91c48ff9362f6bb609252b0d4d758e8

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