Merged with GMCS trunk 42056
[mono.git] / mcs / bmcs / rootcontext.cs
index 2824da00840d2b489a253daa496655bd89113fc5..285889ffe09b6c9a20eeb2261fafa88b559f7ecb 100644 (file)
@@ -123,14 +123,24 @@ namespace Mono.CSharp {
                }
                
                // 
-               // The default compiler checked state
+               // The default compiler checked state. It's "On" in case of VB.NET compiler.
                //
-               static public bool Checked = false;
+               static public bool Checked = true;
+
 
                //
                // Whether to allow Unsafe code
                //
                static public bool Unsafe = false;
+
+               //
+               // VB.NET specific compiler options
+               //
+
+               // 
+               // The default type checking state
+               //
+               static public bool StricterTypeChecking = false;
                
                static string MakeFQN (string nsn, string name)
                {
@@ -320,7 +330,7 @@ namespace Mono.CSharp {
                                // Generic types
                                //
                                "System.Collections.Generic.IEnumerator`1",
-                               "System.Collections.Generic.IEnumerable`1"
+                               "System.Collections.Generic.IEnumerable`1",
                        };
 
                        foreach (string iname in interfaces_first_stage)
@@ -364,6 +374,9 @@ namespace Mono.CSharp {
                        // These are classes that depends on the core interfaces
                        //
                        string [] classes_second_stage = {
+                               "System.Enum",
+                               "System.String",
+                               "System.Array",
                                "System.Reflection.MemberInfo",
                                "System.Type",
                                "System.Exception",
@@ -400,17 +413,18 @@ namespace Mono.CSharp {
                                "System.Security.CodeAccessPermission"
                        };
 
-                       // We must store them here before calling BootstrapCorlib_ResolveDelegate.
-                       TypeManager.string_type = BootstrapCorlib_ResolveClass (root, "System.String");
-                       TypeManager.enum_type = BootstrapCorlib_ResolveClass (root, "System.Enum");
-                       TypeManager.array_type = BootstrapCorlib_ResolveClass (root, "System.Array");
-                       TypeManager.multicast_delegate_type = BootstrapCorlib_ResolveClass (root, "System.MulticastDelegate");
-                       TypeManager.delegate_type = BootstrapCorlib_ResolveClass (root, "System.Delegate");
-                       
                        foreach (string cname in classes_second_stage)
                                BootstrapCorlib_ResolveClass (root, cname);
 
+                       BootstrapCorlib_ResolveStruct (root, "System.Nullable`1");
+
                        BootstrapCorlib_ResolveDelegate (root, "System.AsyncCallback");
+
+                       // These will be defined indirectly during the previous ResolveDelegate.
+                       // However make sure the rest of the checks happen.
+                       string [] delegate_types = { "System.Delegate", "System.MulticastDelegate" };
+                       foreach (string cname in delegate_types)
+                               BootstrapCorlib_ResolveClass (root, cname);
                }
                        
                // <summary>