Null constant cannot be used for ref/out variables
[mono.git] / mcs / mcs / decl.cs
index a32f7d40f47723f08acd669218c6962b8eaf85e3..6cebf38c3b905c358d41d73e13080445cb40ae5a 100644 (file)
@@ -31,7 +31,7 @@ namespace Mono.CSharp {
        //
        public class MemberName {
                public readonly string Name;
-               public readonly TypeArguments TypeArguments;
+               public TypeArguments TypeArguments;
 
                public readonly MemberName Left;
                public readonly Location Location;
@@ -103,6 +103,12 @@ namespace Mono.CSharp {
                        return GetName (false);
                }
 
+               public int Arity {
+                       get {
+                               return TypeArguments == null ? 0 : TypeArguments.Count;
+                       }
+               }
+
                public bool IsGeneric {
                        get {
                                if (TypeArguments != null)
@@ -127,7 +133,7 @@ namespace Mono.CSharp {
                {
                        if (Left == null) {
                                if (TypeArguments != null)
-                                       return new SimpleName (Basename, TypeArguments, Location);
+                                       return new SimpleName (Name, TypeArguments, Location);
                                
                                return new SimpleName (Name, Location);
                        }
@@ -231,7 +237,7 @@ namespace Mono.CSharp {
                }
        }
 
-       class SimpleMemberName
+       public class SimpleMemberName
        {
                public string Value;
                public Location Location;
@@ -247,6 +253,7 @@ namespace Mono.CSharp {
        ///   Base representation for members.  This is used to keep track
        ///   of Name, Location and Modifier flags, and handling Attributes.
        /// </summary>
+       [System.Diagnostics.DebuggerDisplay ("{GetSignatureForError()}")]
        public abstract class MemberCore : Attributable, IMemberContext, IMemberDefinition
        {
                /// <summary>
@@ -263,6 +270,12 @@ namespace Mono.CSharp {
                        }
                }
 
+               string IMemberDefinition.Name {
+                       get {
+                               return member_name.Name;
+                       }
+               }
+
                 // Is not readonly because of IndexerName attribute
                private MemberName member_name;
                public MemberName MemberName {
@@ -284,7 +297,7 @@ namespace Mono.CSharp {
                        }
                }
 
-               public /*readonly*/ DeclSpace Parent;
+               public /*readonly*/ TypeContainer Parent;
 
                /// <summary>
                ///   Location where this declaration happens
@@ -313,7 +326,7 @@ namespace Mono.CSharp {
                        CloseTypeCreated = 1 << 4,              // Tracks whether we have Closed the type
                        HasCompliantAttribute_Undetected = 1 << 5,      // Presence of CLSCompliantAttribute has not been detected
                        HasClsCompliantAttribute = 1 << 6,                      // Type has CLSCompliantAttribute
-                       ClsCompliantAttributeTrue = 1 << 7,                     // Type has CLSCompliant (true)
+                       ClsCompliantAttributeFalse = 1 << 7,                    // Member has CLSCompliant(false)
                        Excluded_Undetected = 1 << 8,           // Conditional attribute has not been detected yet
                        Excluded = 1 << 9,                                      // Method is conditional
                        MethodOverloadsExist = 1 << 10,         // Test for duplication must be performed
@@ -331,12 +344,16 @@ namespace Mono.CSharp {
 
                public MemberCore (DeclSpace parent, MemberName name, Attributes attrs)
                {
-                       this.Parent = parent;
+                       this.Parent = parent as TypeContainer;
                        member_name = name;
                        caching_flags = Flags.Obsolete_Undetected | Flags.ClsCompliance_Undetected | Flags.HasCompliantAttribute_Undetected | Flags.Excluded_Undetected;
                        AddAttributes (attrs, this);
                }
 
+               public virtual Assembly Assembly {
+                       get { return Parent.Module.Assembly; }
+               }
+
                protected virtual void SetMemberName (MemberName new_name)
                {
                        member_name = new_name;
@@ -367,7 +384,7 @@ namespace Mono.CSharp {
                                                if (pm is Indexer.GetIndexerMethod || pm is Indexer.SetIndexerMethod)
                                                        pm = null;
 
-                                               if (pm != null && (pm.Property.Get.IsDummy || pm.Property.Set.IsDummy)) {
+                                               if (pm != null && pm.Property.AccessorSecond == null) {
                                                        Report.Error (840, Location,
                                                                "`{0}' must have a body because it is not marked abstract or extern. The property can be automatically implemented when you define both accessors",
                                                                GetSignatureForError ());
@@ -439,8 +456,7 @@ namespace Mono.CSharp {
                        if (!RootContext.VerifyClsCompliance)
                                return;
 
-                       if (Report.WarningLevel > 0)
-                               VerifyClsCompliance ();
+                       VerifyClsCompliance ();
                }
 
                public bool IsCompilerGenerated {
@@ -452,8 +468,16 @@ namespace Mono.CSharp {
                        }
                }
 
+               public bool IsImported {
+                       get {
+                               return false;
+                       }
+               }
+
                public virtual bool IsUsed {
-                       get { return (caching_flags & Flags.IsUsed) != 0; }
+                       get {
+                               return (caching_flags & Flags.IsUsed) != 0;
+                       }
                }
 
                protected Report Report {
@@ -467,10 +491,15 @@ namespace Mono.CSharp {
                        caching_flags |= Flags.IsUsed;
                }
 
+               public void SetIsAssigned ()
+               {
+                       caching_flags |= Flags.IsAssigned;
+               }
+
                /// <summary>
                /// Returns instance of ObsoleteAttribute for this MemberCore
                /// </summary>
-               public virtual ObsoleteAttribute GetObsoleteAttribute ()
+               public virtual ObsoleteAttribute GetAttributeObsolete ()
                {
                        if ((caching_flags & (Flags.Obsolete_Undetected | Flags.Obsolete)) == 0)
                                return null;
@@ -480,7 +509,7 @@ namespace Mono.CSharp {
                        if (OptAttributes == null)
                                return null;
 
-                       Attribute obsolete_attr = OptAttributes.Search (PredefinedAttributes.Get.Obsolete);
+                       Attribute obsolete_attr = OptAttributes.Search (Compiler.PredefinedAttributes.Obsolete);
                        if (obsolete_attr == null)
                                return null;
 
@@ -498,72 +527,15 @@ namespace Mono.CSharp {
                /// </summary>
                public virtual void CheckObsoleteness (Location loc)
                {
-                       ObsoleteAttribute oa = GetObsoleteAttribute ();
+                       ObsoleteAttribute oa = GetAttributeObsolete ();
                        if (oa != null)
                                AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, Report);
                }
 
-               // Access level of a type.
-               const int X = 1;
-               enum AccessLevel
-               { // Each column represents `is this scope larger or equal to Blah scope'
-                       // Public    Assembly   Protected
-                       Protected = (0 << 0) | (0 << 1) | (X << 2),
-                       Public = (X << 0) | (X << 1) | (X << 2),
-                       Private = (0 << 0) | (0 << 1) | (0 << 2),
-                       Internal = (0 << 0) | (X << 1) | (0 << 2),
-                       ProtectedOrInternal = (0 << 0) | (X << 1) | (X << 2),
-               }
-
-               static AccessLevel GetAccessLevelFromModifiers (Modifiers flags)
-               {
-                       if ((flags & Modifiers.INTERNAL) != 0) {
-
-                               if ((flags & Modifiers.PROTECTED) != 0)
-                                       return AccessLevel.ProtectedOrInternal;
-                               else
-                                       return AccessLevel.Internal;
-
-                       } else if ((flags & Modifiers.PROTECTED) != 0)
-                               return AccessLevel.Protected;
-                       else if ((flags & Modifiers.PRIVATE) != 0)
-                               return AccessLevel.Private;
-                       else
-                               return AccessLevel.Public;
-               }
-
-               //
-               // Returns the access level for type `t'
-               //
-               static AccessLevel GetAccessLevelFromType (Type t)
-               {
-                       if (t.IsPublic)
-                               return AccessLevel.Public;
-                       if (t.IsNestedPrivate)
-                               return AccessLevel.Private;
-                       if (t.IsNotPublic)
-                               return AccessLevel.Internal;
-
-                       if (t.IsNestedPublic)
-                               return AccessLevel.Public;
-                       if (t.IsNestedAssembly)
-                               return AccessLevel.Internal;
-                       if (t.IsNestedFamily)
-                               return AccessLevel.Protected;
-                       if (t.IsNestedFamORAssem)
-                               return AccessLevel.ProtectedOrInternal;
-                       if (t.IsNestedFamANDAssem)
-                               throw new NotImplementedException ("NestedFamANDAssem not implemented, cant make this kind of type from c# anyways");
-
-                       // nested private is taken care of
-
-                       throw new Exception ("I give up, what are you?");
-               }
-
                //
                // Checks whether the type P is as accessible as this member
                //
-               public bool IsAccessibleAs (Type p)
+               public bool IsAccessibleAs (TypeSpec p)
                {
                        //
                        // if M is private, its accessibility is the same as this declspace.
@@ -576,71 +548,72 @@ namespace Mono.CSharp {
                        while (TypeManager.HasElementType (p))
                                p = TypeManager.GetElementType (p);
 
-                       if (TypeManager.IsGenericParameter (p))
+                       if (p.IsGenericParameter)
                                return true;
 
-                       if (TypeManager.IsGenericType (p)) {
-                               foreach (Type t in TypeManager.GetTypeArguments (p)) {
-                                       if (!IsAccessibleAs (t))
-                                               return false;
+                       for (TypeSpec p_parent; p != null; p = p_parent) {
+                               p_parent = p.DeclaringType;
+
+                               if (p.IsGeneric) {
+                                       foreach (TypeSpec t in p.TypeArguments) {
+                                               if (!IsAccessibleAs (t))
+                                                       return false;
+                                       }
                                }
-                       }
 
-                       for (Type p_parent = null; p != null; p = p_parent) {
-                               p_parent = p.DeclaringType;
-                               AccessLevel pAccess = GetAccessLevelFromType (p);
-                               if (pAccess == AccessLevel.Public)
+                               var pAccess = p.Modifiers & Modifiers.AccessibilityMask;
+                               if (pAccess == Modifiers.PUBLIC)
                                        continue;
 
                                bool same_access_restrictions = false;
                                for (MemberCore mc = this; !same_access_restrictions && mc != null && mc.Parent != null; mc = mc.Parent) {
-                                       AccessLevel al = GetAccessLevelFromModifiers (mc.ModFlags);
+                                       var al = mc.ModFlags & Modifiers.AccessibilityMask;
                                        switch (pAccess) {
-                                       case AccessLevel.Internal:
-                                               if (al == AccessLevel.Private || al == AccessLevel.Internal)
+                                       case Modifiers.INTERNAL:
+                                               if (al == Modifiers.PRIVATE || al == Modifiers.INTERNAL)
                                                        same_access_restrictions = TypeManager.IsThisOrFriendAssembly (Parent.Module.Assembly, p.Assembly);
                                                
                                                break;
-                                               
-                                       case AccessLevel.Protected:
-                                               if (al == AccessLevel.Protected) {
-                                                       same_access_restrictions = mc.Parent.IsBaseType (p_parent);
+
+                                       case Modifiers.PROTECTED:
+                                               if (al == Modifiers.PROTECTED) {
+                                                       same_access_restrictions = mc.Parent.IsBaseTypeDefinition (p_parent);
                                                        break;
                                                }
-                                               
-                                               if (al == AccessLevel.Private) {
+
+                                               if (al == Modifiers.PRIVATE) {
                                                        //
                                                        // When type is private and any of its parents derives from
                                                        // protected type then the type is accessible
                                                        //
                                                        while (mc.Parent != null) {
-                                                               if (mc.Parent.IsBaseType (p_parent))
+                                                               if (mc.Parent.IsBaseTypeDefinition (p_parent))
                                                                        same_access_restrictions = true;
                                                                mc = mc.Parent; 
                                                        }
                                                }
                                                
                                                break;
-                                               
-                                       case AccessLevel.ProtectedOrInternal:
-                                               if (al == AccessLevel.Protected)
-                                                       same_access_restrictions = mc.Parent.IsBaseType (p_parent);
-                                               else if (al == AccessLevel.Internal)
+
+                                       case Modifiers.PROTECTED | Modifiers.INTERNAL:
+                                               if (al == Modifiers.INTERNAL)
                                                        same_access_restrictions = TypeManager.IsThisOrFriendAssembly (Parent.Module.Assembly, p.Assembly);
-                                               else if (al == AccessLevel.ProtectedOrInternal)
-                                                       same_access_restrictions = mc.Parent.IsBaseType (p_parent) &&
+                                               else if (al == (Modifiers.PROTECTED | Modifiers.INTERNAL))
+                                                       same_access_restrictions = mc.Parent.IsBaseTypeDefinition (p_parent) &&
                                                                TypeManager.IsThisOrFriendAssembly (Parent.Module.Assembly, p.Assembly);
-                                               
+                                               else
+                                                       goto case Modifiers.PROTECTED;
+
                                                break;
-                                               
-                                       case AccessLevel.Private:
+
+                                       case Modifiers.PRIVATE:
                                                //
                                                // Both are private and share same parent
                                                //
-                                               if (al == AccessLevel.Private) {
+                                               if (al == Modifiers.PRIVATE) {
                                                        var decl = mc.Parent;
                                                        do {
-                                                               same_access_restrictions = TypeManager.IsEqual (decl.TypeBuilder, p_parent);
+                                                               same_access_restrictions = decl.CurrentType == p_parent;
                                                        } while (!same_access_restrictions && !decl.IsTopLevel && (decl = decl.Parent) != null);
                                                }
                                                
@@ -666,16 +639,29 @@ namespace Mono.CSharp {
                        if ((caching_flags & Flags.ClsCompliance_Undetected) == 0)
                                return (caching_flags & Flags.ClsCompliant) != 0;
 
-                       if (GetClsCompliantAttributeValue () && IsExposedFromAssembly ()) {
-                               caching_flags &= ~Flags.ClsCompliance_Undetected;
+                       caching_flags &= ~Flags.ClsCompliance_Undetected;
+
+                       if (HasClsCompliantAttribute) {
+                               if ((caching_flags & Flags.ClsCompliantAttributeFalse) != 0)
+                                       return false;
+
+                               caching_flags |= Flags.ClsCompliant;
+                               return true;
+                       }
+
+                       if (Parent.PartialContainer.IsClsComplianceRequired ()) {
                                caching_flags |= Flags.ClsCompliant;
                                return true;
                        }
 
-                       caching_flags &= ~Flags.ClsCompliance_Undetected;
                        return false;
                }
 
+               public virtual string[] ConditionalConditions ()
+               {
+                       return null;
+               }
+
                /// <summary>
                /// Returns true when MemberCore is exposed from assembly.
                /// </summary>
@@ -684,7 +670,7 @@ namespace Mono.CSharp {
                        if ((ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)
                                return false;
                        
-                       DeclSpace parentContainer = Parent;
+                       DeclSpace parentContainer = Parent.PartialContainer;
                        while (parentContainer != null && parentContainer.ModFlags != 0) {
                                if ((parentContainer.ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)
                                        return false;
@@ -693,9 +679,9 @@ namespace Mono.CSharp {
                        return true;
                }
 
-               public virtual ExtensionMethodGroupExpr LookupExtensionMethod (Type extensionType, string name, Location loc)
+               public virtual IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
                {
-                       return Parent.LookupExtensionMethod (extensionType, name, loc);
+                       return Parent.LookupExtensionMethod (extensionType, name, arity, ref scope);
                }
 
                public virtual FullNamedExpression LookupNamespaceAlias (string name)
@@ -703,42 +689,34 @@ namespace Mono.CSharp {
                        return Parent.NamespaceEntry.LookupNamespaceAlias (name);
                }
 
-               public virtual FullNamedExpression LookupNamespaceOrType (string name, Location loc, bool ignore_cs0104)
+               public virtual FullNamedExpression LookupNamespaceOrType (string name, int arity, Location loc, bool ignore_cs0104)
                {
-                       return Parent.LookupNamespaceOrType (name, loc, ignore_cs0104);
+                       return Parent.LookupNamespaceOrType (name, arity, loc, ignore_cs0104);
                }
 
                /// <summary>
                /// Goes through class hierarchy and gets value of first found CLSCompliantAttribute.
                /// If no is attribute exists then assembly CLSCompliantAttribute is returned.
                /// </summary>
-               public virtual bool GetClsCompliantAttributeValue ()
+               public bool IsNotCLSCompliant ()
                {
                        if ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0)
-                               return (caching_flags & Flags.ClsCompliantAttributeTrue) != 0;
+                               return (caching_flags & Flags.ClsCompliantAttributeFalse) != 0;
 
                        caching_flags &= ~Flags.HasCompliantAttribute_Undetected;
 
                        if (OptAttributes != null) {
-                               Attribute cls_attribute = OptAttributes.Search (
-                                       PredefinedAttributes.Get.CLSCompliant);
+                               Attribute cls_attribute = OptAttributes.Search (Compiler.PredefinedAttributes.CLSCompliant);
                                if (cls_attribute != null) {
                                        caching_flags |= Flags.HasClsCompliantAttribute;
-                                       bool value = cls_attribute.GetClsCompliantAttributeValue ();
-                                       if (value)
-                                               caching_flags |= Flags.ClsCompliantAttributeTrue;
-                                       return value;
+                                       if (cls_attribute.GetClsCompliantAttributeValue ())
+                                               return false;
+
+                                       caching_flags |= Flags.ClsCompliantAttributeFalse;
+                                       return true;
                                }
                        }
-                       
-                       // It's null for TypeParameter
-                       if (Parent == null)
-                               return false;                   
 
-                       if (Parent.GetClsCompliantAttributeValue ()) {
-                               caching_flags |= Flags.ClsCompliantAttributeTrue;
-                               return true;
-                       }
                        return false;
                }
 
@@ -748,7 +726,7 @@ namespace Mono.CSharp {
                protected bool HasClsCompliantAttribute {
                        get {
                                if ((caching_flags & Flags.HasCompliantAttribute_Undetected) != 0)
-                                       GetClsCompliantAttributeValue ();
+                                       IsNotCLSCompliant ();
                                
                                return (caching_flags & Flags.HasClsCompliantAttribute) != 0;
                        }
@@ -770,41 +748,55 @@ namespace Mono.CSharp {
                /// </summary>
                protected virtual bool VerifyClsCompliance ()
                {
-                       if (!IsClsComplianceRequired ()) {
-                               if (HasClsCompliantAttribute && Report.WarningLevel >= 2) {
-                                       if (!IsExposedFromAssembly ()) {
-                                               Attribute a = OptAttributes.Search (PredefinedAttributes.Get.CLSCompliant);
-                                               Report.Warning (3019, 2, a.Location, "CLS compliance checking will not be performed on `{0}' because it is not visible from outside this assembly", GetSignatureForError ());
+                       if (HasClsCompliantAttribute) {
+                               if (CodeGen.Assembly.ClsCompliantAttribute == null) {
+                                       Attribute a = OptAttributes.Search (Compiler.PredefinedAttributes.CLSCompliant);
+                                       if ((caching_flags & Flags.ClsCompliantAttributeFalse) != 0) {
+                                               Report.Warning (3021, 2, a.Location,
+                                                       "`{0}' does not need a CLSCompliant attribute because the assembly is not marked as CLS-compliant",
+                                                       GetSignatureForError ());
+                                       } else {
+                                               Report.Warning (3014, 1, a.Location,
+                                                       "`{0}' cannot be marked as CLS-compliant because the assembly is not marked as CLS-compliant",
+                                                       GetSignatureForError ());
                                        }
+                                       return false;
+                               }
 
-                                       if (!CodeGen.Assembly.IsClsCompliant) {
-                                               Attribute a = OptAttributes.Search (PredefinedAttributes.Get.CLSCompliant);
-                                               Report.Warning (3021, 2, a.Location, "`{0}' does not need a CLSCompliant attribute because the assembly is not marked as CLS-compliant", GetSignatureForError ());
-                                       }
+                               if (!IsExposedFromAssembly ()) {
+                                       Attribute a = OptAttributes.Search (Compiler.PredefinedAttributes.CLSCompliant);
+                                       Report.Warning (3019, 2, a.Location, "CLS compliance checking will not be performed on `{0}' because it is not visible from outside this assembly", GetSignatureForError ());
+                                       return false;
                                }
-                               return false;
-                       }
 
-                       if (HasClsCompliantAttribute) {
-                               if (CodeGen.Assembly.ClsCompliantAttribute == null && !CodeGen.Assembly.IsClsCompliant) {
-                                       Attribute a = OptAttributes.Search (PredefinedAttributes.Get.CLSCompliant);
-                                       Report.Warning (3014, 1, a.Location,
-                                               "`{0}' cannot be marked as CLS-compliant because the assembly is not marked as CLS-compliant",
-                                               GetSignatureForError ());
+                               if ((caching_flags & Flags.ClsCompliantAttributeFalse) != 0) {
+                                       if (Parent.Kind == MemberKind.Interface && Parent.IsClsComplianceRequired ()) {
+                                               Report.Warning (3010, 1, Location, "`{0}': CLS-compliant interfaces must have only CLS-compliant members", GetSignatureForError ());
+                                       } else if (Parent.Kind == MemberKind.Class && (ModFlags & Modifiers.ABSTRACT) != 0 && Parent.IsClsComplianceRequired ()) {
+                                               Report.Warning (3011, 1, Location, "`{0}': only CLS-compliant members can be abstract", GetSignatureForError ());
+                                       }
+
                                        return false;
                                }
 
-                               if (!Parent.IsClsComplianceRequired ()) {
-                                       Attribute a = OptAttributes.Search (PredefinedAttributes.Get.CLSCompliant);
-                                       Report.Warning (3018, 1, a.Location, "`{0}' cannot be marked as CLS-compliant because it is a member of non CLS-compliant type `{1}'", 
+                               if (Parent.Parent != null && !Parent.IsClsComplianceRequired ()) {
+                                       Attribute a = OptAttributes.Search (Compiler.PredefinedAttributes.CLSCompliant);
+                                       Report.Warning (3018, 1, a.Location, "`{0}' cannot be marked as CLS-compliant because it is a member of non CLS-compliant type `{1}'",
                                                GetSignatureForError (), Parent.GetSignatureForError ());
                                        return false;
                                }
+                       } else {
+                               if (!IsExposedFromAssembly ())
+                                       return false;
+
+                               if (!Parent.PartialContainer.IsClsComplianceRequired ())
+                                       return false;
                        }
 
                        if (member_name.Name [0] == '_') {
                                Report.Warning (3008, 1, Location, "Identifier `{0}' is not CLS-compliant", GetSignatureForError () );
                        }
+
                        return true;
                }
 
@@ -844,24 +836,28 @@ namespace Mono.CSharp {
                #region IMemberContext Members
 
                public virtual CompilerContext Compiler {
-                       get { return Parent.Module.Compiler; }
+                       get { return Parent.Compiler; }
                }
 
-               public virtual Type CurrentType {
+               public virtual TypeSpec CurrentType {
                        get { return Parent.CurrentType; }
                }
 
-               public virtual TypeContainer CurrentTypeDefinition {
-                       get { return Parent.CurrentTypeDefinition; }
+               public MemberCore CurrentMemberDefinition {
+                       get { return this; }
                }
 
                public virtual TypeParameter[] CurrentTypeParameters {
                        get { return null; }
                }
 
+               public virtual bool HasUnresolvedConstraints {
+                       get { return false; }
+               }
+
                public bool IsObsolete {
                        get {
-                               if (GetObsoleteAttribute () != null)
+                               if (GetAttributeObsolete () != null)
                                        return true;
 
                                return Parent == null ? false : Parent.IsObsolete;
@@ -878,7 +874,9 @@ namespace Mono.CSharp {
                }
 
                public bool IsStatic {
-                       get { return (ModFlags & Modifiers.STATIC) != 0; }
+                       get {
+                               return (ModFlags & Modifiers.STATIC) != 0;
+                       }
                }
 
                #endregion
@@ -894,54 +892,249 @@ namespace Mono.CSharp {
                protected enum StateFlags
                {
                        Obsolete_Undetected = 1,        // Obsolete attribute has not been detected yet
-                       Obsolete = 1 << 1                       // Member has obsolete attribute
+                       Obsolete = 1 << 1,                      // Member has obsolete attribute
+                       CLSCompliant_Undetected = 1 << 3,       // CLSCompliant attribute has not been detected yet
+                       CLSCompliant = 1 << 4,          // Member is CLS Compliant
+
+                       IsAccessor = 1 << 9,            // Method is an accessor
+                       IsGeneric = 1 << 10,            // Member contains type arguments
+
+                       PendingMetaInflate = 1 << 12,
+                       PendingMakeMethod = 1 << 13,
+                       PendingMemberCacheMembers = 1 << 14,
+                       PendingBaseTypeInflate = 1 << 15,
+                       InterfacesExpanded = 1 << 16,
+                       IsNotRealProperty = 1 << 17,
                }
 
-               readonly Modifiers modifiers;
-               readonly string name;
+               protected Modifiers modifiers;
                protected StateFlags state;
                protected IMemberDefinition definition;
                public readonly MemberKind Kind;
+               protected TypeSpec declaringType;
+
+#if DEBUG
+               static int counter;
+               public int ID = counter++;
+#endif
 
-               protected MemberSpec (MemberKind kind, IMemberDefinition definition, string name, Modifiers modifiers)
+               protected MemberSpec (MemberKind kind, TypeSpec declaringType, IMemberDefinition definition, Modifiers modifiers)
                {
+                       this.Kind = kind;
+                       this.declaringType = declaringType;
                        this.definition = definition;
-                       this.name = name;
                        this.modifiers = modifiers;
 
-                       state = StateFlags.Obsolete_Undetected;
+                       state = StateFlags.Obsolete_Undetected | StateFlags.CLSCompliant_Undetected;
+               }
+
+               #region Properties
+
+               public Assembly Assembly {
+                       get {
+                               return definition.Assembly;
+                       }
+               }
+
+               public virtual int Arity {
+                       get {
+                               return 0;
+                       }
+               }
+
+               public TypeSpec DeclaringType {
+                       get {
+                               return declaringType;
+                       }
+                       set {
+                               declaringType = value;
+                       }
+               }
+
+               public IMemberDefinition MemberDefinition {
+                       get {
+                               return definition;
+                       }
+               }
+
+               public Modifiers Modifiers {
+                       get {
+                               return modifiers;
+                       }
+                       set {
+                               modifiers = value;
+                       }
+               }
+               
+               public virtual string Name {
+                       get {
+                               return definition.Name;
+                       }
+               }
+
+               public bool IsAbstract {
+                       get { return (modifiers & Modifiers.ABSTRACT) != 0; }
+               }
+
+               public bool IsAccessor {
+                       get {
+                               return (state & StateFlags.IsAccessor) != 0;
+                       }
+                       set {
+                               state = value ? state | StateFlags.IsAccessor : state & ~StateFlags.IsAccessor;
+                       }
                }
 
-               public abstract Type DeclaringType { get; }
+               //
+               // Return true when this member is a generic in C# terms
+               // A nested non-generic type of generic type will return false
+               //
+               public bool IsGeneric {
+                       get {
+                               return (state & StateFlags.IsGeneric) != 0;
+                       }
+                       set {
+                               state = value ? state | StateFlags.IsGeneric : state & ~StateFlags.IsGeneric;
+                       }
+               }
 
-               public ObsoleteAttribute GetObsoleteAttribute ()
+               public bool IsPrivate {
+                       get { return (modifiers & Modifiers.PRIVATE) != 0; }
+               }
+
+               public bool IsPublic {
+                       get { return (modifiers & Modifiers.PUBLIC) != 0; }
+               }
+
+               public bool IsStatic {
+                       get { 
+                               return (modifiers & Modifiers.STATIC) != 0;
+                       }
+               }
+
+               #endregion
+
+               public virtual ObsoleteAttribute GetAttributeObsolete ()
                {
                        if ((state & (StateFlags.Obsolete | StateFlags.Obsolete_Undetected)) == 0)
                                return null;
 
                        state &= ~StateFlags.Obsolete_Undetected;
 
-                       var oa = definition.GetObsoleteAttribute ();
+                       var oa = definition.GetAttributeObsolete ();
                        if (oa != null)
                                state |= StateFlags.Obsolete;
 
                        return oa;
                }
 
-               public IMemberDefinition MemberDefinition {
-                       get { return definition; }
+               protected virtual bool IsNotCLSCompliant ()
+               {
+                       return MemberDefinition.IsNotCLSCompliant ();
                }
 
-               public Modifiers Modifiers {
-                       get { return modifiers; }
+               public virtual string GetSignatureForError ()
+               {
+                       var bf = MemberDefinition as Property.BackingField;
+                       var name = bf == null ? Name : bf.OriginalName;
+                       return DeclaringType.GetSignatureForError () + "." + name;
                }
+
+               public virtual MemberSpec InflateMember (TypeParameterInflator inflator)
+               {
+                       var inflated = (MemberSpec) MemberwiseClone ();
+                       inflated.declaringType = inflator.TypeInstance;
+                       inflated.state |= StateFlags.PendingMetaInflate;
+#if DEBUG
+                       if (inflated.ID > 0)
+                               inflated.ID = -inflated.ID;
+#endif
+                       return inflated;
+               }
+
+               //
+               // Is this member accessible from invocationType
+               //
+               public bool IsAccessible (TypeSpec invocationType)
+               {
+                       var ma = Modifiers & Modifiers.AccessibilityMask;
+                       if (ma == Modifiers.PUBLIC)
+                               return true;
+
+                       var parentType = /* this as TypeSpec ?? */ DeclaringType;
                
-               public string Name {
-                       get { return name; }
+                       //
+                       // If only accessible to the current class or children
+                       //
+                       if (ma == Modifiers.PRIVATE)
+                               return invocationType.MemberDefinition == parentType.MemberDefinition ||
+                                       TypeManager.IsNestedChildOf (invocationType, parentType);
+
+                       if ((ma & Modifiers.INTERNAL) != 0) {
+                               var b = TypeManager.IsThisOrFriendAssembly (invocationType == InternalType.FakeInternalType ?
+                                        CodeGen.Assembly.Builder : invocationType.Assembly, Assembly);
+                               if (b || ma == Modifiers.INTERNAL)
+                                       return b;
+                       }
+
+                       // PROTECTED
+                       if (!TypeManager.IsNestedFamilyAccessible (invocationType, parentType))
+                               return false;
+
+                       return true;
                }
 
-               public bool IsStatic {
-                       get { return (modifiers & Modifiers.STATIC) != 0; }
+               //
+               // Returns member CLS compliance based on full member hierarchy
+               //
+               public bool IsCLSCompliant ()
+               {
+                       if ((state & StateFlags.CLSCompliant_Undetected) != 0) {
+                               state &= ~StateFlags.CLSCompliant_Undetected;
+
+                               if (IsNotCLSCompliant ())
+                                       return false;
+
+                               bool compliant;
+                               if (DeclaringType != null) {
+                                       compliant = DeclaringType.IsCLSCompliant ();
+                               } else {
+                                       // TODO: NEED AssemblySpec
+                                       if (MemberDefinition.IsImported) {
+                                               var attr = MemberDefinition.Assembly.GetCustomAttributes (typeof (CLSCompliantAttribute), false);
+                                               compliant = attr.Length > 0 && ((CLSCompliantAttribute) attr[0]).IsCompliant;
+                                       } else {
+                                               compliant = CodeGen.Assembly.IsClsCompliant;
+                                       }
+                               }
+
+                               if (compliant)
+                                       state |= StateFlags.CLSCompliant;
+                       }
+
+                       return (state & StateFlags.CLSCompliant) != 0;
+               }
+
+               public bool IsConditionallyExcluded (Location loc)
+               {
+                       if ((Kind & (MemberKind.Class | MemberKind.Method)) == 0)
+                               return false;
+
+                       var conditions = MemberDefinition.ConditionalConditions ();
+                       if (conditions == null)
+                               return false;
+
+                       foreach (var condition in conditions) {
+                               if (loc.CompilationUnit.IsConditionalDefined (condition))
+                                       return false;
+                       }
+
+                       return true;
+               }
+
+               public override string ToString ()
+               {
+                       return GetSignatureForError ();
                }
        }
 
@@ -951,18 +1144,32 @@ namespace Mono.CSharp {
        //
        public interface IMemberDefinition
        {
-               ObsoleteAttribute GetObsoleteAttribute ();
+               Assembly Assembly { get; }
+               string Name { get; }
+               bool IsImported { get; }
+
+               string[] ConditionalConditions ();
+               ObsoleteAttribute GetAttributeObsolete ();
+               bool IsNotCLSCompliant ();
+               void SetIsAssigned ();
                void SetIsUsed ();
        }
 
-       /// <summary>
-       ///   Base class for structs, classes, enumerations and interfaces.  
-       /// </summary>
-       /// <remarks>
-       ///   They all create new declaration spaces.  This
-       ///   provides the common foundation for managing those name
-       ///   spaces.
-       /// </remarks>
+       public interface IParametersMember : IInterfaceMemberSpec
+       {
+               AParametersCollection Parameters { get; }
+       }
+
+       public interface IInterfaceMemberSpec
+       {
+               TypeSpec MemberType { get; }
+       }
+
+       //
+       // Base type container declaration. It exists to handle partial types
+       // which share same definition (PartialContainer) but have different
+       // resolve scopes
+       //
        public abstract class DeclSpace : MemberCore {
                /// <summary>
                ///   This points to the actual definition that is being
@@ -970,13 +1177,6 @@ namespace Mono.CSharp {
                /// </summary>
                public TypeBuilder TypeBuilder;
 
-               /// <summary>
-               ///   If we are a generic type, this is the type we are
-               ///   currently defining.  We need to lookup members on this
-               ///   instead of the TypeBuilder.
-               /// </summary>
-               protected Type currentType;
-
                //
                // This is the namespace in which this typecontainer
                // was declared.  We use this to resolve names.
@@ -1087,11 +1287,7 @@ namespace Mono.CSharp {
                        defined_names.TryGetValue (name, out mc);
                        return mc;
                }
-
-               public bool IsStaticClass {
-                       get { return (ModFlags & Modifiers.STATIC) != 0; }
-               }
-               
+       
                // 
                // root_types contains all the types.  All TopLevel types
                // hence have a parent that points to `root_types', that is
@@ -1106,27 +1302,6 @@ namespace Mono.CSharp {
                        return false;
                }
 
-               public virtual void CloseType ()
-               {
-                       if ((caching_flags & Flags.CloseTypeCreated) == 0){
-                               try {
-                                       TypeBuilder.CreateType ();
-                               } catch {
-                                       //
-                                       // The try/catch is needed because
-                                       // nested enumerations fail to load when they
-                                       // are defined.
-                                       //
-                                       // Even if this is the right order (enumerations
-                                       // declared after types).
-                                       //
-                                       // Note that this still creates the type and
-                                       // it is possible to save it
-                               }
-                               caching_flags |= Flags.CloseTypeCreated;
-                       }
-               }
-
                protected virtual TypeAttributes TypeAttr {
                        get { return Module.DefaultCharSetType; }
                }
@@ -1143,164 +1318,74 @@ namespace Mono.CSharp {
                                type.GetSignatureForError ());
                }
 
-               public override void Emit ()
-               {
-                       if (type_params != null) {
-                               int offset = count_type_params - type_params.Length;
-                               for (int i = offset; i < type_params.Length; i++)
-                                       CurrentTypeParameters [i - offset].Emit ();
-                       }
-
-                       if ((ModFlags & Modifiers.COMPILER_GENERATED) != 0 && !Parent.IsCompilerGenerated)
-                               PredefinedAttributes.Get.CompilerGenerated.EmitAttribute (TypeBuilder);
-
-                       base.Emit ();
-               }
-
                public override string GetSignatureForError ()
-               {       
+               {
                        return MemberName.GetSignatureForError ();
                }
                
-               public bool CheckAccessLevel (Type check_type)
+               public bool CheckAccessLevel (TypeSpec check_type)
                {
-                       Type tb = TypeBuilder;
+// TODO: Use this instead
+//                     return PartialContainer.Definition.IsAccessible (check_type);
 
-                       if (this is GenericMethod) {
-                               tb = Parent.TypeBuilder;
+                       TypeSpec tb = PartialContainer.Definition;
+                       check_type = check_type.GetDefinition ();
 
-                               // FIXME: Generic container does not work with nested generic
-                               // anonymous method stories
-                               if (TypeBuilder == null)
-                                       return true;
-                       }
-
-                       check_type = TypeManager.DropGenericTypeArguments (check_type);
-                       if (check_type == tb)
-                               return true;
-
-                       // TODO: When called from LocalUsingAliasEntry tb is null
-                       // because we are in RootDeclSpace
-                       if (tb == null)
-                               tb = typeof (RootDeclSpace);
-
-                       //
-                       // Broken Microsoft runtime, return public for arrays, no matter what 
-                       // the accessibility is for their underlying class, and they return 
-                       // NonPublic visibility for pointers
-                       //
-                       if (TypeManager.HasElementType (check_type))
-                               return CheckAccessLevel (TypeManager.GetElementType (check_type));
-
-                       if (TypeManager.IsGenericParameter (check_type))
-                               return true;
-
-                       TypeAttributes check_attr = check_type.Attributes & TypeAttributes.VisibilityMask;
+                       var check_attr = check_type.Modifiers & Modifiers.AccessibilityMask;
 
                        switch (check_attr){
-                       case TypeAttributes.Public:
+                       case Modifiers.PUBLIC:
                                return true;
 
-                       case TypeAttributes.NotPublic:
-                               return TypeManager.IsThisOrFriendAssembly (Module.Assembly, check_type.Assembly);
+                       case Modifiers.INTERNAL:
+                               return TypeManager.IsThisOrFriendAssembly (Assembly, check_type.Assembly);
                                
-                       case TypeAttributes.NestedPublic:
-                               return CheckAccessLevel (check_type.DeclaringType);
+                       case Modifiers.PRIVATE:
+                               TypeSpec declaring = check_type.DeclaringType;
+                               return tb == declaring.GetDefinition () || TypeManager.IsNestedChildOf (tb, declaring); 
 
-                       case TypeAttributes.NestedPrivate:
-                               Type declaring = check_type.DeclaringType;
-                               return tb == declaring || TypeManager.IsNestedChildOf (tb, declaring);  
-
-                       case TypeAttributes.NestedFamily:
+                       case Modifiers.PROTECTED:
                                //
                                // Only accessible to methods in current type or any subtypes
                                //
-                               return FamilyAccessible (tb, check_type);
-
-                       case TypeAttributes.NestedFamANDAssem:
-                               return TypeManager.IsThisOrFriendAssembly (Module.Assembly, check_type.Assembly) && 
-                                       FamilyAccessible (tb, check_type);
+                               return TypeManager.IsNestedFamilyAccessible (tb, check_type.DeclaringType);
 
-                       case TypeAttributes.NestedFamORAssem:
-                               return FamilyAccessible (tb, check_type) ||
-                                       TypeManager.IsThisOrFriendAssembly (Module.Assembly, check_type.Assembly);
-
-                       case TypeAttributes.NestedAssembly:
-                               return TypeManager.IsThisOrFriendAssembly (Module.Assembly, check_type.Assembly);
-                       }
-
-                       throw new NotImplementedException (check_attr.ToString ());
-               }
-
-               static bool FamilyAccessible (Type tb, Type check_type)
-               {
-                       Type declaring = check_type.DeclaringType;
-                       return TypeManager.IsNestedFamilyAccessible (tb, declaring);
-               }
-
-               public bool IsBaseType (Type baseType)
-               {
-                       if (TypeManager.IsInterfaceType (baseType))
-                               throw new NotImplementedException ();
-
-                       Type type = TypeBuilder;
-                       while (type != null) {
-                               if (TypeManager.IsEqual (type, baseType))
+                       case Modifiers.PROTECTED | Modifiers.INTERNAL:
+                               if (TypeManager.IsThisOrFriendAssembly (Assembly, check_type.Assembly))
                                        return true;
 
-                               type = type.BaseType;
+                               goto case Modifiers.PROTECTED;
                        }
 
-                       return false;
+                       throw new NotImplementedException (check_attr.ToString ());
                }
 
-               private Type LookupNestedTypeInHierarchy (string name)
+               private TypeSpec LookupNestedTypeInHierarchy (string name, int arity)
                {
-                       Type t = null;
-                       // if the member cache has been created, lets use it.
-                       // the member cache is MUCH faster.
-                       if (MemberCache != null) {
-                               t = MemberCache.FindNestedType (name);
-                               if (t == null)
-                                       return null;
-                       }
+                       // TODO: GenericMethod only
+                       if (PartialContainer == null)
+                               return null;
 
-                       //
-                       // FIXME: This hack is needed because member cache does not work
-                       // with nested base generic types, it does only type name copy and
-                       // not type construction
-                       //
+                       // Has any nested type
+                       // Does not work, because base type can have
+                       //if (PartialContainer.Types == null)
+                       //      return null;
 
-                       // no member cache. Do it the hard way -- reflection
-                       for (Type current_type = TypeBuilder;
-                            current_type != null && current_type != TypeManager.object_type;
-                            current_type = current_type.BaseType) {
-
-                               Type ct = TypeManager.DropGenericTypeArguments (current_type);
-                               if (ct is TypeBuilder) {
-                                       TypeContainer tc = ct == TypeBuilder
-                                               ? PartialContainer : TypeManager.LookupTypeContainer (ct);
-                                       if (tc != null)
-                                               t = tc.FindNestedType (name);
-                               } else {
-                                       t = TypeManager.GetNestedType (ct, name);
-                               }
+                       var container = PartialContainer.CurrentType;
 
-                               if ((t == null) || !CheckAccessLevel (t))
-                                       continue;
-
-                               if (!TypeManager.IsGenericType (current_type))
-                                       return t;
+                       // Is not Root container
+                       if (container == null)
+                               return null;
 
-                               Type[] args = TypeManager.GetTypeArguments (current_type);
-                               Type[] targs = TypeManager.GetTypeArguments (t);
-                               for (int i = 0; i < args.Length; i++)
-                                       targs [i] = TypeManager.TypeToCoreType (args [i]);
+                       var     t = MemberCache.FindNestedType (container, name, arity);
+                       if (t == null)
+                               return null;
 
-                               return t.MakeGenericType (targs);
-                       }
+                       // FIXME: Breaks error reporting
+                       if (!t.IsAccessible (CurrentType))
+                               return null;
 
-                       return null;
+                       return t;
                }
 
                //
@@ -1310,73 +1395,50 @@ namespace Mono.CSharp {
                //
                // Returns: Type or null if they type can not be found.
                //
-               public override FullNamedExpression LookupNamespaceOrType (string name, Location loc, bool ignore_cs0104)
+               public override FullNamedExpression LookupNamespaceOrType (string name, int arity, Location loc, bool ignore_cs0104)
                {
                        FullNamedExpression e;
-                       if (Cache.TryGetValue (name, out e))
+                       if (arity == 0 && Cache.TryGetValue (name, out e))
                                return e;
 
                        e = null;
                        int errors = Report.Errors;
 
-                       TypeParameter[] tp = CurrentTypeParameters;
-                       if (tp != null) {
-                               TypeParameter tparam = TypeParameter.FindTypeParameter (tp, name);
-                               if (tparam != null)
-                                       e = new TypeParameterExpr (tparam, Location.Null);
+                       if (arity == 0) {
+                               TypeParameter[] tp = CurrentTypeParameters;
+                               if (tp != null) {
+                                       TypeParameter tparam = TypeParameter.FindTypeParameter (tp, name);
+                                       if (tparam != null)
+                                               e = new TypeParameterExpr (tparam, Location.Null);
+                               }
                        }
 
                        if (e == null) {
-                               Type t = LookupNestedTypeInHierarchy (name);
+                               TypeSpec t = LookupNestedTypeInHierarchy (name, arity);
 
                                if (t != null)
                                        e = new TypeExpression (t, Location.Null);
                                else if (Parent != null)
-                                       e = Parent.LookupNamespaceOrType (name, loc, ignore_cs0104);
+                                       e = Parent.LookupNamespaceOrType (name, arity, loc, ignore_cs0104);
                                else
-                                       e = NamespaceEntry.LookupNamespaceOrType (name, loc, ignore_cs0104);
+                                       e = NamespaceEntry.LookupNamespaceOrType (name, arity, loc, ignore_cs0104);
                        }
 
-                       if (errors == Report.Errors)
+                       // TODO MemberCache: How to cache arity stuff ?
+                       if (errors == Report.Errors && arity == 0)
                                Cache [name] = e;
                        
                        return e;
                }
 
-               /// <remarks>
-               ///   This function is broken and not what you're looking for.  It should only
-               ///   be used while the type is still being created since it doesn't use the cache
-               ///   and relies on the filter doing the member name check.
-               /// </remarks>
-               ///
-               // [Obsolete ("Only MemberCache approach should be used")]
-               public virtual MemberList FindMembers (MemberTypes mt, BindingFlags bf,
-                                                       MemberFilter filter, object criteria)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               /// <remarks>
-               ///   If we have a MemberCache, return it.  This property may return null if the
-               ///   class doesn't have a member cache or while it's still being created.
-               /// </remarks>
-               public abstract MemberCache MemberCache {
-                       get;
+               public override Assembly Assembly {
+                       get { return Module.Assembly; }
                }
 
                public virtual ModuleContainer Module {
                        get { return Parent.Module; }
                }
 
-               public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb, PredefinedAttributes pa)
-               {
-                       if (a.Type == pa.Required) {
-                               Report.Error (1608, a.Location, "The RequiredAttribute attribute is not permitted on C# types");
-                               return;
-                       }
-                       TypeBuilder.SetCustomAttribute (cb);
-               }
-
                TypeParameter[] initialize_type_params ()
                {
                        if (type_param_list != null)
@@ -1447,7 +1509,7 @@ namespace Mono.CSharp {
                                                        --total;
                                                        continue;
                                                }
-                                               if (constraints_at.TypeParameter == name.Name) {
+                                               if (constraints_at.TypeParameter.Value == name.Name) {
                                                        constraints = constraints_at;
                                                        constraints_list.RemoveAt(ii);
                                                        break;
@@ -1462,7 +1524,7 @@ namespace Mono.CSharp {
                                }
 
                                type_params [i] = new TypeParameter (
-                                       Parent, this, name.Name, constraints, name.OptAttributes, variance, Location);
+                                       Parent, i, new MemberName (name.Name, Location), constraints, name.OptAttributes, variance);
 
                                AddToContainer (type_params [i], name.Name);
                        }
@@ -1470,12 +1532,12 @@ namespace Mono.CSharp {
                        if (constraints_list != null && constraints_list.Count > 0) {
                                foreach (Constraints constraint in constraints_list) {
                                        Report.Error(699, constraint.Location, "`{0}': A constraint references nonexistent type parameter `{1}'", 
-                                               GetSignatureForError (), constraint.TypeParameter);
+                                               GetSignatureForError (), constraint.TypeParameter.Value);
                                }
                        }
                }
 
-               public TypeParameter[] TypeParameters {
+               protected TypeParameter[] TypeParameters {
                        get {
                                if (!IsGeneric)
                                        throw new InvalidOperationException ();
@@ -1488,26 +1550,12 @@ namespace Mono.CSharp {
                        }
                }
 
-               public override Type CurrentType {
-                       get { return currentType != null ? currentType : TypeBuilder; }
-               }
-
-               public override TypeContainer CurrentTypeDefinition {
-                       get { return PartialContainer; }
-               }
-
                public int CountTypeParameters {
                        get {
                                return count_type_params;
                        }
                }
 
-               // Used for error reporting only
-               public virtual Type LookupAnyGeneric (string typeName)
-               {
-                       return NamespaceEntry.NS.LookForAnyGenericType (typeName);
-               }
-
                public override string[] ValidAttributeTargets {
                        get { return attribute_targets; }
                }
@@ -1520,35 +1568,10 @@ namespace Mono.CSharp {
 
                        if (type_params != null) {
                                foreach (TypeParameter tp in type_params) {
-                                       if (tp.Constraints == null)
-                                               continue;
-
-                                       tp.Constraints.VerifyClsCompliance (Report);
+                                       tp.VerifyClsCompliance ();
                                }
                        }
 
-                       var cache = TypeManager.AllClsTopLevelTypes;
-                       if (cache == null)
-                               return true;
-
-                       string lcase = Name.ToLower (System.Globalization.CultureInfo.InvariantCulture);
-                       if (!cache.ContainsKey (lcase)) {
-                               cache.Add (lcase, this);
-                               return true;
-                       }
-
-                       object val = cache [lcase];
-                       if (val == null) {
-                               Type t = AttributeTester.GetImportedIgnoreCaseClsType (lcase);
-                               if (t == null)
-                                       return true;
-                               Report.SymbolRelatedToPreviousError (t);
-                       }
-                       else {
-                               Report.SymbolRelatedToPreviousError ((DeclSpace)val);
-                       }
-
-                       Report.Warning (3005, 1, Location, "Identifier `{0}' differing only in case is not CLS-compliant", GetSignatureForError ());
                        return true;
                }
        }