[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / mcs / decl.cs
index d60e6ca0aece20e9b2e085ff78ab2c8146817449..b173b7b71fba74ac7c662715847f2825ba20c4ef 100644 (file)
@@ -18,7 +18,7 @@ using System.Diagnostics;
 using System.Text;
 using Mono.CompilerServices.SymbolWriter;
 
-#if NET_2_1
+#if MOBILE
 using XmlElement = System.Object;
 #else
 using System.Xml;
@@ -290,7 +290,8 @@ namespace Mono.CSharp {
                        HasInstanceConstructor = 1 << 16,
                        HasUserOperators = 1 << 17,
                        CanBeReused = 1 << 18,
-                       InterfacesExpanded = 1 << 19
+                       InterfacesExpanded = 1 << 19,
+                       HasInstanceField = 1 << 20
                }
 
                /// <summary>
@@ -508,16 +509,6 @@ namespace Mono.CSharp {
                        return obsolete;
                }
 
-               /// <summary>
-               /// Checks for ObsoleteAttribute presence. It's used for testing of all non-types elements
-               /// </summary>
-               public virtual void CheckObsoleteness (Location loc)
-               {
-                       ObsoleteAttribute oa = GetAttributeObsolete ();
-                       if (oa != null)
-                               AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, Report);
-               }
-
                //
                // Checks whether the type P is as accessible as this member
                //
@@ -534,6 +525,9 @@ namespace Mono.CSharp {
                        while (TypeManager.HasElementType (p))
                                p = TypeManager.GetElementType (p);
 
+                       if (p.BuiltinType != BuiltinTypeSpec.Type.None)
+                               return true;
+
                        if (p.IsGenericParameter)
                                return true;
 
@@ -553,6 +547,10 @@ namespace Mono.CSharp {
 
                                bool same_access_restrictions = false;
                                for (MemberCore mc = this; !same_access_restrictions && mc != null && mc.Parent != null; mc = mc.Parent) {
+                                       var tc = mc as TypeContainer;
+                                       if (tc != null && tc.PartialContainer != null)
+                                               mc = tc.PartialContainer;
+
                                        var al = mc.ModFlags & Modifiers.AccessibilityMask;
                                        switch (pAccess) {
                                        case Modifiers.INTERNAL:
@@ -928,6 +926,7 @@ namespace Mono.CSharp {
                        MissingDependency = 1 << 5,
                        HasDynamicElement = 1 << 6,
                        ConstraintsChecked = 1 << 7,
+                       HasNamedTupleElement = 1 << 8,
 
                        IsAccessor = 1 << 9,            // Method is an accessor
                        IsGeneric = 1 << 10,            // Member contains type arguments
@@ -944,6 +943,7 @@ namespace Mono.CSharp {
                        GenericIterateInterface = 1 << 21,
                        GenericTask = 1 << 22,
                        InterfacesImported = 1 << 23,
+                       Tuple = 1 << 24
                }
 
                //
@@ -953,7 +953,7 @@ namespace Mono.CSharp {
                        StateFlags.CLSCompliant | StateFlags.CLSCompliant_Undetected |
                        StateFlags.Obsolete | StateFlags.Obsolete_Undetected |
                        StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected |
-                       StateFlags.HasDynamicElement;
+                       StateFlags.HasDynamicElement | StateFlags.HasNamedTupleElement;
 
                protected Modifiers modifiers;
                public StateFlags state;
@@ -1071,6 +1071,16 @@ namespace Mono.CSharp {
 
                #endregion
 
+               public virtual void CheckObsoleteness (IMemberContext mc, Location loc)
+               {
+                       var oa = GetAttributeObsolete ();
+                       if (oa == null)
+                               return;
+
+                       if (!mc.IsObsolete)
+                               AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, mc.Module.Compiler.Report);
+               }
+
                public virtual ObsoleteAttribute GetAttributeObsolete ()
                {
                        if ((state & (StateFlags.Obsolete | StateFlags.Obsolete_Undetected)) == 0)