using System.Text;
using Mono.CompilerServices.SymbolWriter;
-#if NET_2_1
+#if MOBILE
using XmlElement = System.Object;
#else
using System.Xml;
HasInstanceConstructor = 1 << 16,
HasUserOperators = 1 << 17,
CanBeReused = 1 << 18,
- InterfacesExpanded = 1 << 19
+ InterfacesExpanded = 1 << 19,
+ HasInstanceField = 1 << 20
}
/// <summary>
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
//
while (TypeManager.HasElementType (p))
p = TypeManager.GetElementType (p);
+ if (p.BuiltinType != BuiltinTypeSpec.Type.None)
+ return true;
+
if (p.IsGenericParameter)
return true;
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:
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
GenericIterateInterface = 1 << 21,
GenericTask = 1 << 22,
InterfacesImported = 1 << 23,
+ Tuple = 1 << 24
}
//
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;
#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)