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


Don <clugd...@yahoo.com.au> changed:

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


--- Comment #1 from Don <clugd...@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: -------

Reply via email to