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


Iain Buclaw <ibuc...@ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |ibuc...@ubuntu.com


--- Comment #6 from Iain Buclaw <ibuc...@ubuntu.com> 2011-04-23 12:39:40 PDT ---
Patch:

diff --git a/src/mtype.c b/src/mtype.c
index f8ad06e..1d1fcd6 100644
--- a/src/mtype.c
+++ b/src/mtype.c
@@ -4173,6 +4173,17 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e,
Identifier *ident)
     else
 #endif
     {
+        /* Create a new temporary variable for literal arrays.
+         */
+        if (e->op == TOKassocarrayliteral)
+        {
+            Identifier *idtmp = Lexer::uniqueId("__aatmp");
+            VarDeclaration *aatmp = new VarDeclaration(loc, e->type, idtmp,
new ExpInitializer(0, e));
+            aatmp->storage_class |= STCctfe;
+            Expression *ae = new DeclarationExp(loc, aatmp);
+            e = new CommaExp(loc, ae, new VarExp(loc, aatmp));
+            e = e->semantic(sc);
+        }
         e->type = getImpl()->type;
         e = e->type->dotExp(sc, e, ident);
         //e = Type::dotExp(sc, e, ident);

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

Reply via email to