HasStructLayout = 1 << 15, // Has StructLayoutAttribute
HasInstanceConstructor = 1 << 16,
HasUserOperators = 1 << 17,
- CanBeReused = 1 << 18
+ CanBeReused = 1 << 18,
+ InterfacesExpanded = 1 << 19
}
/// <summary>
/// </summary>
internal Flags caching_flags;
- public MemberCore (TypeContainer parent, MemberName name, Attributes attrs)
+ protected MemberCore (TypeContainer parent, MemberName name, Attributes attrs)
{
this.Parent = parent;
member_name = name;
if ((mod_flags & Modifiers.COMPILER_GENERATED) != 0)
return true;
- return Parent == null ? false : Parent.IsCompilerGenerated;
+ return Parent != null && Parent.IsCompilerGenerated;
}
}
caching_flags |= Flags.IsAssigned;
}
- public void SetConstraints (List<Constraints> constraints_list)
+ public virtual void SetConstraints (List<Constraints> constraints_list)
{
var tparams = member_name.TypeParameters;
if (tparams == null) {
if (GetAttributeObsolete () != null)
return true;
- return Parent == null ? false : Parent.IsObsolete;
+ return Parent != null && Parent.IsObsolete;
}
}
if ((ModFlags & Modifiers.UNSAFE) != 0)
return true;
- return Parent == null ? false : Parent.IsUnsafe;
+ return Parent != null && Parent.IsUnsafe;
}
}
InflatedExpressionType = 1 << 19,
InflatedNullableType = 1 << 20,
GenericIterateInterface = 1 << 21,
- GenericTask = 1 << 22
+ GenericTask = 1 << 22,
+ InterfacesImported = 1 << 23,
}
//
this.definition = definition;
this.modifiers = modifiers;
- state = StateFlags.Obsolete_Undetected | StateFlags.CLSCompliant_Undetected | StateFlags.MissingDependency_Undetected;
+ if (kind == MemberKind.MissingType)
+ state = StateFlags.MissingDependency;
+ else
+ state = StateFlags.Obsolete_Undetected | StateFlags.CLSCompliant_Undetected | StateFlags.MissingDependency_Undetected;
}
#region Properties
// will contain types only but it can have numerous values for members
// like methods where both return type and all parameters are checked
//
- public List<TypeSpec> GetMissingDependencies ()
+ public List<MissingTypeSpecReference> GetMissingDependencies ()
+ {
+ return GetMissingDependencies (this);
+ }
+
+ public List<MissingTypeSpecReference> GetMissingDependencies (MemberSpec caller)
{
if ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)
return null;
state &= ~StateFlags.MissingDependency_Undetected;
var imported = definition as ImportedDefinition;
- List<TypeSpec> missing;
+ List<MissingTypeSpecReference> missing;
if (imported != null) {
- missing = ResolveMissingDependencies ();
+ missing = ResolveMissingDependencies (caller);
} else if (this is ElementTypeSpec) {
- missing = ((ElementTypeSpec) this).Element.GetMissingDependencies ();
+ missing = ((ElementTypeSpec) this).Element.GetMissingDependencies (caller);
} else {
missing = null;
}
return missing;
}
- public abstract List<TypeSpec> ResolveMissingDependencies ();
+ public abstract List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller);
protected virtual bool IsNotCLSCompliant (out bool attrValue)
{
var ctype = ctx.CurrentType;
if (ma == Modifiers.PRIVATE) {
- if (ctype == null)
+ if (ctype == null || parentType == null)
return false;
//
// It's only accessible to the current class or children
return (state & StateFlags.CLSCompliant) != 0;
}
- public bool IsConditionallyExcluded (IMemberContext ctx, Location loc)
+ public bool IsConditionallyExcluded (IMemberContext ctx)
{
if ((Kind & (MemberKind.Class | MemberKind.Method)) == 0)
return false;
void SetIsUsed ();
}
+ public interface IMethodDefinition : IMemberDefinition
+ {
+ MethodBase Metadata { get; }
+ }
+
public interface IParametersMember : IInterfaceMemberSpec
{
AParametersCollection Parameters { get; }