To avoid Array modifiers specified on both a variable and its type
authorManjula GHM <manjula@mono-cvs.ximian.com>
Thu, 7 Jul 2005 07:06:04 +0000 (07:06 -0000)
committerManjula GHM <manjula@mono-cvs.ximian.com>
Thu, 7 Jul 2005 07:06:04 +0000 (07:06 -0000)
svn path=/trunk/mcs/; revision=47026

mcs/mbas/ChangeLog
mcs/mbas/mb-parser.jay

index fe4c2b6b5712f69b37c049aca0b344bff11a15a4..0ae8adeb9ffed62ab53a056a506edea218fdb0a6 100644 (file)
@@ -1,3 +1,6 @@
+2005-07-07 Manjula GHM <mmanjula@novell.com>
+       * mb-parser.jay: To avoid Array modifiers specified on both a variable and its type
+
 2005-07-06 Umadevi S <sumadevi@novell.com>
        * statement.cs - suppressing warnings due to unused variables in mbas compiler.
 
index 51210e81b79da4b4c65ca64c3c822cec9bfd6320..9c909b27173a95c963d97eee443326d0ddefaa9e 100644 (file)
@@ -3891,6 +3891,7 @@ variable_declarator
                ArrayList VarDeclarations = new ArrayList();
                Expression vartype;
                ArrayList a_dims = null;
+               Expression exp;
 
                if ((names.Count > 1) && (varinit != null)) 
                        Report.Error (
@@ -3905,6 +3906,14 @@ variable_declarator
                        current_rank_specifiers = (ArrayList) vname.Rank;
                        a_dims = null;
                        varinit = $4;
+                       exp = (Expression)$3;
+
+
+                       if (VariableDeclaration.IsArrayDecl (this) &&  (exp is MemberAccess))
+                                Report.Error (
+                                        31087, (Location)$1,
+                                        "Array modifiers can not specified on both a variable and its type" );
+
 
                        if(vname.Type != null && $3 != null)
                                Report.Error (