Made the check more transparent
authorMarek Safar <marek.safar@gmail.com>
Fri, 26 Mar 2010 14:53:03 +0000 (14:53 -0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 26 Mar 2010 14:53:03 +0000 (14:53 -0000)
svn path=/trunk/mcs/; revision=154282

mcs/mcs/cs-parser.jay

index cacbf592f0ae8cae4a7d62bc5afa35b1e2e22bda..51b50955b8083df4e559667e9005fb243fa1d8fe 100644 (file)
@@ -2948,10 +2948,7 @@ base_type_name
        : type
          {
                if ($1 is ComposedCast) {
-                       if (lexer.ConstraintsParsing)
-                               Report.Error (706, GetLocation ($1), "Invalid constraint type `{0}'", ((ComposedCast)$1).GetSignatureForError ());
-                       else
-                               Report.Error (1521, GetLocation ($1), "Invalid base type `{0}'", ((ComposedCast)$1).GetSignatureForError ());
+                       Report.Error (1521, GetLocation ($1), "Invalid base type `{0}'", ((ComposedCast)$1).GetSignatureForError ());
                }
                $$ = $1;
          }
@@ -4350,8 +4347,11 @@ type_parameter_constraints
        ;
 
 type_parameter_constraint
-       : base_type_name
+       : type
          {
+               if ($1 is ComposedCast)
+                       Report.Error (706, GetLocation ($1), "Invalid constraint type `{0}'", ((ComposedCast)$1).GetSignatureForError ());
+         
                $$ = $1;
          }
        | NEW OPEN_PARENS CLOSE_PARENS