public static int WarningLevel;
public static Target Target;
- public static string TargetExt = ".exe";
+ public static string TargetExt;
public static bool VerifyClsCompliance = true;
StrongNameDelaySign = false;
MainClass = null;
Target = Target.Exe;
+ TargetExt = ".exe";
Version = LanguageVersion.Default;
Documentation = null;
+ impl_details_class = null;
}
public static bool NeedsEntryPoint {
//
static public bool Unsafe;
- static string MakeFQN (string nsn, string name)
- {
- if (nsn == "")
- return name;
- return String.Concat (nsn, ".", name);
- }
-
// <remarks>
// This function is used to resolve the hierarchy tree.
// It processes interfaces, structs and classes in that order.
ArrayList ifaces = root.Interfaces;
if (ifaces != null){
- foreach (Interface i in ifaces)
+ foreach (TypeContainer i in ifaces)
i.DefineType ();
}
{
object o = root.GetDefinition (name);
if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
+ Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
return null;
}
{
object o = root.GetDefinition (name);
if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
+ Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
return;
}
{
object o = root.GetDefinition (name);
if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
+ Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
return;
}
{
object o = root.GetDefinition (name);
if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
+ Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
return;
}
"System.InvalidOperationException",
"System.NotSupportedException",
"System.MarshalByRefObject",
- "System.Security.CodeAccessPermission"
+ "System.Security.CodeAccessPermission",
+ "System.Runtime.CompilerServices.RequiredAttributeAttribute",
+ "System.Runtime.InteropServices.GuidAttribute",
+ "System.Reflection.AssemblyCultureAttribute"
};
foreach (string cname in classes_second_stage)
helper_classes.Add (helper_class);
}
- static void Report1530 (Location loc)
- {
- Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
- }
-
static public void PopulateCoreType (TypeContainer root, string name)
{
DeclSpace ds = (DeclSpace) root.GetDefinition (name);
if (RootContext.StdLib){
foreach (TypeContainer tc in type_container_resolve_order)
tc.DefineMembers (root);
+
} else {
foreach (TypeContainer tc in type_container_resolve_order) {
// When compiling corlib, these types have already been
ArrayList delegates = root.Delegates;
if (delegates != null){
foreach (Delegate d in delegates)
- if ((d.ModFlags & Modifiers.NEW) == 0)
- d.DefineMembers (root);
- else
- Report1530 (d.Location);
+ d.DefineMembers (root);
}
ArrayList enums = root.Enums;
if (enums != null){
foreach (Enum en in enums)
- if ((en.ModFlags & Modifiers.NEW) == 0)
- en.DefineMembers (root);
- else
- Report1530 (en.Location);
+ en.DefineMembers (root);
}
//
{
TypeContainer root = Tree.Types;
+ ArrayList delegates = root.Delegates;
+ if (delegates != null){
+ foreach (Delegate d in delegates)
+ d.Define ();
+ }
+
if (type_container_resolve_order != null){
foreach (TypeContainer tc in type_container_resolve_order) {
// When compiling corlib, these types have already been
(tc.Name == "System.Runtime.CompilerServices.IndexerNameAttribute")))
continue;
- if ((tc.ModFlags & Modifiers.NEW) == 0)
- tc.Define ();
+ tc.Define ();
}
}
- ArrayList delegates = root.Delegates;
- if (delegates != null){
- foreach (Delegate d in delegates)
- if ((d.ModFlags & Modifiers.NEW) == 0)
- d.Define ();
- }
-
ArrayList enums = root.Enums;
if (enums != null){
foreach (Enum en in enums)
- if ((en.ModFlags & Modifiers.NEW) == 0)
- en.Define ();
+ en.Define ();
}
}
if (type_container_resolve_order != null) {
foreach (TypeContainer tc in type_container_resolve_order)
tc.EmitType ();
+
+ if (Report.Errors > 0)
+ return;
+
+ foreach (TypeContainer tc in type_container_resolve_order)
+ tc.VerifyMembers ();
}
if (Tree.Types.Delegates != null) {
return fb;
}
+
+ public static void CheckUnsafeOption (Location loc)
+ {
+ if (!Unsafe) {
+ Report.Error (227, loc,
+ "Unsafe code requires the `unsafe' command line option to be specified");
+ }
+ }
}
}