+2004-06-13 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay: Don't allow generic attributes.
+
2004-06-13 Martin Baulig <martin@ximian.com>
* class.cs (MemberBase.DoDefineBase): New protected method.
}
opt_attribute_arguments
{
- string name = ((MemberName) $1).GetName ();
+ MemberName mname = (MemberName) $1;
+ if (mname.IsGeneric) {
+ Report.Error (404, lexer.Location,
+ "'<' unexpected: attributes cannot be generic");
+ }
+ string name = mname.GetName ();
if (current_attr_target == "assembly" || current_attr_target == "module")
$$ = new GlobalAttribute (current_container, current_attr_target,
name, (ArrayList) $3, (Location) $2);
return Name;
}
+ public bool IsGeneric {
+ get {
+ if (TypeArguments != null)
+ return true;
+ else if (Left != null)
+ return Left.IsGeneric;
+ else
+ return false;
+ }
+ }
+
public string GetName (bool is_generic)
{
string name = is_generic ? Basename : Name;