www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8602] New: Assertion failure

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

           Summary: Assertion failure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ellery-newcomer utulsa.edu



14:20:43 PDT ---
dmd 2.060

code:

template ReturnType(func...) if (func.length == 1) { }

struct BinaryOperatorX(string _op, rhs_t,C) {
    ReturnType!(mixin("C.opBinary!(_op,rhs_t)")) RET_T;
}

class MyClass {
    auto opBinary(string op, T)() { }
}

void PydMain() {
    BinaryOperatorX!("+", int, MyClass);
}

fireworks:
dmd: mtype.c:5254: virtual void TypeFunction::toDecoBuffer(OutBuffer*, int):
Assertion `next' failed.

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


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major



This is an internal compiler error; it deserves some attention.

Also, confirmed that it still happens in latest git dmd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 23 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8602


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Assertion failure           |ICE(mtype.c) string mixin +
                   |                            |auto return type + template
                   |                            |tuple



Very marginally simplified. If you take out the "if (func.length == 1)" then it
segfaults instead.
-------------
template ReturnType(func...) if (func.length == 1) { }

struct MyClass {
    auto xopBinary(T)() { }
}

struct BinaryOperatorX() {
    ReturnType!(mixin("MyClass.xopBinary!(int)")) RET_T;
}

void PydMain() {
    BinaryOperatorX!();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8602




Further reduced.
------------------
template T8602(func...) if (func.length == 1) { }

struct Bug8602 {
    auto xx() { }
}

T8602!(mixin("Bug8602.xx")) mm;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8602




The problem is that at the end of CompileExp::semantic, the result is xx, but
the type of xx is still not known because it was a return-type inferred
function.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8602


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



13:45:19 PST ---

 Further reduced.
 ------------------
 template T8602(func...) if (func.length == 1) { }
 
 struct Bug8602 {
     auto xx() { }
 }
 
 T8602!(mixin("Bug8602.xx")) mm;
The ICE is gone in git-head, now only gives: Error: T8602!(xx) is used as a type -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 04 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8602


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME





 Further reduced.
 ------------------
 template T8602(func...) if (func.length == 1) { }
 
 struct Bug8602 {
     auto xx() { }
 }
 
 T8602!(mixin("Bug8602.xx")) mm;
The ICE is gone in git-head, now only gives: Error: T8602!(xx) is used as a type
This is correct behavior, because T8602!(Bug8602.xx) does not make a type. Maybe this is a dup of bug 5933. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 05 2013