[Issue 5214] Compiler crash with array of empty {}

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 13 18:23:39 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5214


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code, patch
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-11-13 18:22:30 PST ---
PATCH: declaration.c, line 751.
init->toExpression returns NULL if it fails. (BTW this is case where
non-nullable types would catch a bug <g>. Although it was trivial to track
down, it's lain hidden in the code for ages).
Give it the same error message as happens in D1.


            if (ai->isAssociativeArray())
                e = ai->toAssocArrayLiteral();
            else
                e = init->toExpression();
+            if (!e)
+            {
+                error("cannot infer type from initializer");
+                e = new ErrorExp();
+            }
            init = new ExpInitializer(e->loc, e);
            type = init->inferType(sc);

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


More information about the Digitalmars-d-bugs mailing list