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


--- Comment #0 from Ryuichi OHORI <r.97all gmail.com> 2013-07-11 05:16:57 PDT
---
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



--- Comment #1 from Don <clugdbug yahoo.com.au> 2013-08-21 03:00:49 PDT ---
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



--- Comment #2 from Don <clugdbug yahoo.com.au> 2013-08-22 12:45:24 PDT ---
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


--- Comment #3 from yebblies <yebblies gmail.com> 2013-08-23 13:45:34 EST ---
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