* class.cs, cs-parser.jay: Early check for base types expression.
svn path=/trunk/mcs/; revision=100928
+2008-04-16 Marek Safar <marek.safar@gmail.com>
+
+ * class.cs, cs-parser.jay: Early check for base types expression.
+
2008-04-16 Marek Safar <marek.safar@gmail.com>
* decl.cs (MemberName): Declare PrettyName as obsolete.
return ifaces;
}
- if (base_class.Type.IsArray || base_class.Type.IsPointer) {
- Report.Error (1521, base_class.Location, "Invalid base type");
- return ifaces;
- }
-
if (base_class.IsSealed){
Report.SymbolRelatedToPreviousError (base_class.Type);
if (base_class.Type.IsAbstract) {
;
type_list
- : type
+ : base_type_name
{
- ArrayList types = new ArrayList (4);
-
+ ArrayList types = new ArrayList (2);
types.Add ($1);
$$ = types;
}
- | type_list COMMA type
+ | type_list COMMA base_type_name
{
ArrayList types = (ArrayList) $1;
-
types.Add ($3);
$$ = types;
}
;
+base_type_name
+ : type
+ {
+ if ($1 is ComposedCast)
+ Report.Error (1521, GetLocation ($1), "Invalid base type `{0}'", ((ComposedCast)$1).GetSignatureForError ());
+ $$ = $1;
+ }
+ ;
+
/*
* replaces all the productions for isolating the various
* simple types, but we need this to reuse it easily in local_variable_type