www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3911] New: Associative array in CTFE crashes compiler

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

           Summary: Associative array in CTFE crashes compiler
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This crashes the compiler:

auto bunch(T)(T[] items...) {
    return ["+" : 0];
}
enum int* r = "+" in bunch(1);
void main() {}



The following variant of the same program doesn't crash the compiler, but gives
a forward reference error, that seems wrong:
Error: forward reference to bunch


auto bunch() {
    return ["+" : 0];
}
enum int* r = "+" in bunch();
void main() {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 09 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3911




This fixes the ICE:
expression.c line 7181.
----

    if (!type)
    {
    error("forward reference to inferred return type of function call %s",
toChars());
    type = Type::terror;
+    return new ErrorExp();
    }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 29 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3911




*** Issue 4012 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 29 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3911


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



14:53:37 PDT ---
changeset 430

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 01 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3911


bearophile_hugs eml.cc changed:

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



This bug was about two different problems, one of them is now fixed.
So I close this bug and move a simplified version of the code that generates
the error in bug 4075.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 09 2010