2007-02-11 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / rootcontext.cs
index 5778a87eeb68b48f4d08fe3deba2af950e294bf2..07e3d3afd37e032e5a1fcf3745419fa166219ba0 100644 (file)
@@ -20,7 +20,8 @@ namespace Mono.CSharp {
        public enum LanguageVersion
        {
                Default = 0,
-               ISO_1   = 1
+               ISO_1   = 1,
+               LINQ
        }
 
        public class RootContext {
@@ -191,7 +192,7 @@ namespace Mono.CSharp {
                //
                // Resolves a single class during the corlib bootstrap process
                //
-               static TypeBuilder BootstrapCorlib_ResolveClass (TypeContainer root, string name)
+               static Type BootstrapCorlib_ResolveClass (TypeContainer root, string name)
                {
                        object o = root.GetDefinition (name);
                        if (o == null){
@@ -210,7 +211,10 @@ namespace Mono.CSharp {
                                return null;
                        }
 
-                       return ((DeclSpace) o).DefineType ();
+                       Type t = ((DeclSpace) o).DefineType ();
+                       if (t != null)
+                               AttributeTester.RegisterNonObsoleteType (t);
+                       return t;
                }
 
                //
@@ -260,7 +264,9 @@ namespace Mono.CSharp {
                                return;
                        }
 
-                       ((DeclSpace) o).DefineType ();
+                       Type t = ((DeclSpace) o).DefineType ();
+                       if (t != null)
+                               AttributeTester.RegisterNonObsoleteType (t);
                }
 
                //
@@ -292,7 +298,13 @@ namespace Mono.CSharp {
                        TypeManager.system_object_expr.Type = TypeManager.object_type;
                        TypeManager.value_type = BootstrapCorlib_ResolveClass (root, "System.ValueType");
                        TypeManager.system_valuetype_expr.Type = TypeManager.value_type;
+
+                       //
+                       // The core attributes
+                       //
+                       BootstrapCorlib_ResolveInterface (root, "System.Runtime.InteropServices._Attribute");
                        TypeManager.attribute_type = BootstrapCorlib_ResolveClass (root, "System.Attribute");
+                       TypeManager.obsolete_attribute_type = BootstrapCorlib_ResolveClass (root, "System.ObsoleteAttribute");
                        TypeManager.indexer_name_type = BootstrapCorlib_ResolveClass (root, "System.Runtime.CompilerServices.IndexerNameAttribute");
                        
                        string [] interfaces_first_stage = {
@@ -390,7 +402,6 @@ namespace Mono.CSharp {
                                "System.Runtime.CompilerServices.FixedBufferAttribute",
 #endif
                                "System.Diagnostics.ConditionalAttribute",
-                               "System.ObsoleteAttribute",
                                "System.ParamArrayAttribute",
                                "System.CLSCompliantAttribute",
                                "System.Security.UnverifiableCodeAttribute",