-// <summary>
-// Used to report back to the user the result of a declaration
-// in the current declaration space
-// </summary>
-void
-CheckDef (DeclSpace.AdditionResult result, string name, Location l)
-{
- if (result == DeclSpace.AdditionResult.Success)
- return;
-
- switch (result){
- case DeclSpace.AdditionResult.NameExists:
- Report.Error (102, l, "The container `" + current_container.Name +
- "' already contains a definition for `"+
- name + "'");
- break;
-
-
- //
- // This is handled only for static Constructors, because
- // in reality we handle these by the semantic analysis later
- //
- case DeclSpace.AdditionResult.MethodExists:
- Report.Error (
- 111, l, "Class `"+current_container.Name+
- "' already defines a member called '" +
- name + "' with the same parameter types (more than one default constructor)");
- break;
-
- case DeclSpace.AdditionResult.EnclosingClash:
- Report.Error (542, l, "Member names cannot be the same as their enclosing type");
- break;
-
- case DeclSpace.AdditionResult.NotAConstructor:
- Report.Error (1520, l, "Class, struct, or interface method must have a return type");
- break;
-
- case DeclSpace.AdditionResult.Error:
- // Error has already been reported.
- break;
- }
-}
-
-void
-CheckDef (bool result, string name, Location l)
-{
- if (result)
- return;
- CheckDef (DeclSpace.AdditionResult.NameExists, name, l);
-}
-