Преглед на файлове

2003-03-31 Gaurav Vaish <[email protected]>

* cs-parser.jay: Attributes cannot be applied to
                 namespaces. Fixes #40473

svn path=/trunk/mcs/; revision=12962
Gaurav Vaish преди 23 години
родител
ревизия
8a99bc3e53
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      mcs/mcs/cs-parser.jay

+ 4 - 0
mcs/mcs/cs-parser.jay

@@ -320,6 +320,10 @@ namespace_declaration
 			foreach (AttributeSection asec in attrs.AttributeSections)
 				if (asec.Target == "assembly")
 					RootContext.AddGlobalAttributeSection (current_container, asec);
+				else
+					Report.Error(1518, Lexer.Location,
+					"Attributes cannot be applied to namespaces."
+					+ " Expected class, delegate, enum, interface, or struct");
 		}
 
 		current_namespace = RootContext.Tree.RecordNamespace (current_namespace, file, (string) $3);