Fix cs0231-[34].cs.
authorRaja R Harinath <harinath@hurrynot.org>
Mon, 29 May 2006 08:54:23 +0000 (08:54 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Mon, 29 May 2006 08:54:23 +0000 (08:54 -0000)
* mcs/cs-parser.jay (formal_parameter_list): Extend the pattern below
to param arguments too.
* gmcs/cs-parser.jay: Likewise.

svn path=/trunk/mcs/; revision=61222

mcs/errors/cs0231-3.cs [new file with mode: 0644]
mcs/errors/cs0231-4.cs [new file with mode: 0644]
mcs/gmcs/ChangeLog
mcs/gmcs/cs-parser.jay
mcs/mcs/ChangeLog
mcs/mcs/cs-parser.jay

diff --git a/mcs/errors/cs0231-3.cs b/mcs/errors/cs0231-3.cs
new file mode 100644 (file)
index 0000000..e11b0bc
--- /dev/null
@@ -0,0 +1,7 @@
+// cs0231-3.cs: A params parameter must be the last parameter in a formal parameter list
+// Line: 5
+class Test
+{
+        void Foo (int i, params object[] o, bool b) {}
+}
+
diff --git a/mcs/errors/cs0231-4.cs b/mcs/errors/cs0231-4.cs
new file mode 100644 (file)
index 0000000..d186ba2
--- /dev/null
@@ -0,0 +1,7 @@
+// cs0231-4.cs: A params parameter must be the last parameter in a formal parameter list
+// Line: 5
+class Test
+{
+       void Foo (int i, params object[] o, params bool[] b) {}
+}
+
index 3450861b9ccab0c224c4f4f5d0264e5a0b0f3d57..eb992db3e4e7535aedfc4ca0a64560dcb234e717 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-29  Raja R Harinath  <rharinath@novell.com>
+
+       Fix cs0231-[34].cs.
+       * cs-parser.jay (formal_parameter_list): Extend the pattern below
+       to param arguments too.
+
 2006-05-26  Miguel de Icaza  <miguel@novell.com>
 
        * cs-parser.jay: Catch another parsing form for arglist being
index c0e08b978bacadb2f082410ebe66d8005a202f54..9fb775e9587327fc60b1c671b2e5f6e503a8a234 100644 (file)
@@ -1242,6 +1242,12 @@ formal_parameter_list
                        Report.Error (231, ((Parameter) $1).Location, "A params parameter must be the last parameter in a formal parameter list");
                $$ = null;
          }
+       | fixed_parameters COMMA parameter_array COMMA error
+         {
+               if ($3 != null)
+                       Report.Error (231, ((Parameter) $3).Location, "A params parameter must be the last parameter in a formal parameter list");
+               $$ = null;
+         }
        | ARGLIST COMMA error
          {
                Report.Error (257, (Location) $1, "An __arglist parameter must be the last parameter in a formal parameter list");
index 367085d270003bee94bafc53fe4bde855235d6f9..7ea6fdb09c0839fcd699dc6bc60dcac971229d14 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-29  Raja R Harinath  <rharinath@novell.com>
+
+       Fix cs0231-[34].cs.
+       * cs-parser.jay (formal_parameter_list): Extend the pattern below
+       to param arguments too.
+
 2006-05-26  Miguel de Icaza  <miguel@novell.com>
 
        * cs-parser.jay: Catch another parsing form for arglist being
index badd68048453e38db8d374b4ccd571a9e40f818a..30beddad3bd1acbaf4b19df4ffce93c3ad5c914c 100644 (file)
@@ -1174,6 +1174,12 @@ formal_parameter_list
                        Report.Error (231, ((Parameter) $1).Location, "A params parameter must be the last parameter in a formal parameter list");
                $$ = null;
          }
+       | fixed_parameters COMMA parameter_array COMMA error
+         {
+               if ($3 != null)
+                       Report.Error (231, ((Parameter) $3).Location, "A params parameter must be the last parameter in a formal parameter list");
+               $$ = null;
+         }
        | ARGLIST COMMA error
          {
                Report.Error (257, (Location) $1, "An __arglist parameter must be the last parameter in a formal parameter list");