[mcs] Parsing of nested unbound types. Fixes #55400
authorMarek Safar <marek.safar@gmail.com>
Wed, 24 May 2017 17:26:46 +0000 (19:26 +0200)
committerMarek Safar <marek.safar@gmail.com>
Wed, 24 May 2017 17:28:44 +0000 (19:28 +0200)
mcs/errors/cs1031-3.cs [new file with mode: 0644]
mcs/mcs/cs-tokenizer.cs

diff --git a/mcs/errors/cs1031-3.cs b/mcs/errors/cs1031-3.cs
new file mode 100644 (file)
index 0000000..3126dfa
--- /dev/null
@@ -0,0 +1,18 @@
+// CS1031: Type expected
+// Line: 16
+
+public class B<Y>  where Y: B<Y>
+{
+}
+
+public class A<X>: B<A<X>>
+{
+}
+
+public class Repro
+{
+       public static void Main (string[] args)
+       {
+               var h = typeof (B<A<>>);
+       }
+}
\ No newline at end of file
index e6a95fe8163a3590acb9f23602cc10d4cdec63dd..d6314ff005a3222079d9eb1eb746b258780da2f8 100644 (file)
@@ -1267,7 +1267,8 @@ namespace Mono.CSharp
                        else if (the_token == Token.INTERR_NULLABLE || the_token == Token.STAR)
                                goto again;
                        else if (the_token == Token.OP_GENERICS_LT) {
-                               if (!parse_less_than (ref genericDimension))
+                               int unused = 0;
+                               if (!parse_less_than (ref unused))
                                        return false;
                                goto again;
                        } else if (the_token == Token.OPEN_BRACKET) {