www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9718] New: [ICE] With a simple Algebraic

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

           Summary: [ICE] With a simple Algebraic
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-03-14 06:18:05 PDT ---
import std.variant: Algebraic;
Spam foo() {
    return Spam.init;
}
struct Bar {
    Spam baz() {
        return Spam.init;
    }
}
alias Algebraic!(Bar) Spam;
void main() {}



DMD 2.063alpha gives:

Assertion failure: 'global.errors' on line 5886 in file 'template.c'



If I swap foo() and Bar{} it compiles:


import std.variant: Algebraic;
struct Bar {
    Spam baz() {
        return Spam.init;
    }
}
Spam foo() {
    return Spam.init;
}
alias Algebraic!(Bar) Spam;
void main() {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 14 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9718



--- Comment #1 from bearophile_hugs eml.cc 2013-03-14 11:32:07 PDT ---
Reduced test case:


template Foo(T) {
    enum size_t Foo = T.sizeof;
}
Spam s1;
struct Bar {
    Spam s2;
}
alias int[Foo!Bar] Spam;
void main() {}

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