Hi Alexandre,

Attached patch fixes the issue I was discussing with you some time
ago, when BC31087 was being triggered for code like this:

Dim X(7) As System.Integer

The patch extends the testsuite to also cover this case.

I've also attached a small patch that fixes running the testsuite with
non-bash shells (well, any shells that don't support &>).

Cheers,

Jelmer
Index: mbas/Test/misc/Makefile
===================================================================
--- mbas/Test/misc/Makefile     (revision 51911)
+++ mbas/Test/misc/Makefile     (working copy)
@@ -12,7 +12,7 @@
        $(RUNTIME) $(RUNTIME_FLAGS) --debug WriteOK.exe --sayho /about 
-say:this,that,those /say:what?
 
 WriteOK.exe: $(WRITEOK_SOURCES) Makefile ../../mbas.exe
-       $(BASCOMPILE) --stacktrace --reference=Mono.GetOptions 
-r:System.Data,System.Messaging --main WriteOK $(WRITEOK_SOURCES) &> verbose.log
+       $(BASCOMPILE) --stacktrace --reference=Mono.GetOptions 
-r:System.Data,System.Messaging --main WriteOK $(WRITEOK_SOURCES) 2>&1 > 
verbose.log
        @grep "Compilation" verbose.log
 
 verbose:
@@ -20,15 +20,15 @@
        $(MAKE) LOCAL_MBAS_FLAGS='--verbosegetoptions --verbose --stacktrace' 
WriteOK.exe
 
 aspx_temp.dll: aspx_temp.vb Makefile ../../mbas.exe
-       $(BASCOMPILE) --stacktrace /target:library /r:"System.dll" 
/r:"System.Xml.dll" /r:"System.Data.dll" /r:"System.Web.dll" 
/r:"System.Web.Services.dll" /r:"System.Drawing.dll" -- aspx_temp.vb  &> 
verbose.aspx.log
+       $(BASCOMPILE) --stacktrace /target:library /r:"System.dll" 
/r:"System.Xml.dll" /r:"System.Data.dll" /r:"System.Web.dll" 
/r:"System.Web.Services.dll" /r:"System.Drawing.dll" -- aspx_temp.vb  2>&1 > 
verbose.aspx.log
        @grep "Compilation" verbose.aspx.log
 
 test.exe: test.vb ctest.vb Makefile ../../mbas.exe
-       $(BASCOMPILE) -r:System.Windows.Forms -r:System.Drawing test.vb 
ctest.vb &> verbose.test.log
+       $(BASCOMPILE) -r:System.Windows.Forms -r:System.Drawing test.vb 
ctest.vb 2>&1 > verbose.test.log
        @grep "Compilation" verbose.test.log
 
 gtk.exe: gtk.vb Makefile ../../mbas.exe
-       $(BASCOMPILE) -pkg:gtk-sharp gtk.vb &> verbose.gtk.log
+       $(BASCOMPILE) -pkg:gtk-sharp gtk.vb 2>&1 > verbose.gtk.log
        @grep "Compilation" verbose.gtk.log
 
 profile: $(WRITEOK_SOURCES) Makefile
Index: Test/tests/types/ArrayA.vb
===================================================================
--- Test/tests/types/ArrayA.vb  (revision 53165)
+++ Test/tests/types/ArrayA.vb  (working copy)
@@ -10,6 +10,7 @@
     Dim h() as Integer
     Dim i as integer(,)
     Dim j as integer()
+       Dim k(4) as System.Integer
 
     Sub Main()
 
Index: mb-parser.jay
===================================================================
--- mb-parser.jay       (revision 53165)
+++ mb-parser.jay       (working copy)
@@ -4371,7 +4371,6 @@
                ArrayList VarDeclarations = new ArrayList();
                Expression vartype;
                ArrayList a_dims = null;
-               Expression exp;
 
                if ((names.Count > 1) && (varinit != null)) 
                        Report.Error (
@@ -4386,17 +4385,12 @@
                        current_rank_specifiers = (ArrayList) vname.Rank;
                        a_dims = null;
                        varinit = $4;
-                       exp = (Expression)$3;
 
-
-                       // FIXME: Check whether exp is a Type and not a class 
member or something
-                       // FIXME: Check whether vname and exp are not both 
arrays.
-                       if (VariableDeclaration.IsArrayDecl (this) &&  (exp is 
MemberAccess))
+                       if (VariableDeclaration.IsArrayDecl (this) && 
$3.ToString().IndexOf('[') >= 0)
                                 Report.Error (
-                                        31087, (Location)$1,
-                                        "Array modifiers can not specified on 
both a variable and its type" );
+                                      31087, (Location)$1,
+                                       "Array modifiers can not specified on 
both a variable and its type" );
 
-
                        if(vname.Type != null && $3 != null)
                                Report.Error (
                                        30302, (Location)$1, 
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 53165)
+++ ChangeLog   (working copy)
@@ -1,3 +1,7 @@
+2005-11-17 Jelmer Vernooij <[EMAIL PROTECTED]>
+       * mb-parser.jay: fix error handling when array modifiers are specified
+       on both type and variable name
+
 2005-11-09 Renato Suga <[EMAIL PROTECTED]>
        * mb-parser.jay: added STOP to statement rule to allow a keyword STOP
        in an iteration_statement.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Mono-vb mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-vb

Reply via email to