Author: raja
Date: 2006-09-22 08:22:20 -0400 (Fri, 22 Sep 2006)
New Revision: 65811

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/expression.cs
Log:
* expression.cs (ComposedCast): Check for arrays of TypedReference
before creating the type, not after.


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2006-09-22 10:00:58 UTC (rev 65810)
+++ trunk/mcs/mcs/ChangeLog     2006-09-22 12:22:20 UTC (rev 65811)
@@ -1,3 +1,8 @@
+2006-09-22  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * expression.cs (ComposedCast): Check for arrays of TypedReference
+       before creating the type, not after.
+
 2006-09-21  Marek Safar  <[EMAIL PROTECTED]>
 
        * cfold.cs, const.cs, enum.cs, statement.cs: Updated

Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2006-09-22 10:00:58 UTC (rev 65810)
+++ trunk/mcs/mcs/expression.cs 2006-09-22 12:22:20 UTC (rev 65811)
@@ -8686,8 +8686,13 @@
                        }
 #endif
 
-                       if (dim == "*" && !TypeManager.VerifyUnManaged (ltype, 
loc)) {
+                       if (dim == "*" && !TypeManager.VerifyUnManaged (ltype, 
loc))
                                return null;
+
+                       if (dim [0] == '[' &&
+                           (ltype == TypeManager.arg_iterator_type || ltype == 
TypeManager.typed_reference_type)) {
+                               Report.Error (611, loc, "Array elements cannot 
be of type `{0}'", TypeManager.CSharpName (ltype));
+                               return null;
                        }
 
                        if (dim != "")
@@ -8695,21 +8700,14 @@
                        else
                                type = ltype;
 
-                       if (type == null) {
+                       if (type == null)
                                throw new InternalErrorException ("Couldn't 
create computed type " + ltype + dim);
-                       }
 
                        if (type.IsPointer && !ec.IsInUnsafeScope){
                                UnsafeError (loc);
                                return null;
                        }
 
-                       if (type.IsArray && (type.GetElementType () == 
TypeManager.arg_iterator_type ||
-                               type.GetElementType () == 
TypeManager.typed_reference_type)) {
-                               Report.Error (611, loc, "Array elements cannot 
be of type `{0}'", TypeManager.CSharpName (type.GetElementType ()));
-                               return null;
-                       }
-                       
                        eclass = ExprClass.Type;
                        return this;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to