namespace Mono.CSharp
{
+ //
+ // Inflated or non-inflated representation of any type.
+ //
public class TypeSpec : MemberSpec
{
protected MetaType info;
}
}
+ //
+ // A cache of all type members (including nested types)
+ //
public MemberCache MemberCache {
get {
if (cache == null || (state & StateFlags.PendingMemberCacheMembers) != 0)
return aua;
}
+ //
+ // Return metadata information used during emit to describe the type
+ //
public virtual MetaType GetMetaInfo ()
{
return info;
return this;
}
+ //
+ // Text representation of type used by documentation writer
+ //
public override string GetSignatureForDocumentation ()
{
StringBuilder sb = new StringBuilder ();
return new InflatedTypeSpec (inflator.Context, this, inflator.TypeInstance, targs);
}
+ //
+ // Inflates current type using specific type arguments
+ //
public InflatedTypeSpec MakeGenericType (IModuleContext context, TypeSpec[] targs)
{
if (targs.Length == 0 && !IsNested)
}
}
+ if (MemberDefinition.TypeParametersCount > 0) {
+ foreach (var tp in MemberDefinition.TypeParameters) {
+ var tp_missing = tp.GetMissingDependencies ();
+ if (tp_missing != null) {
+ if (missing == null)
+ missing = new List<TypeSpec> ();
+
+ missing.AddRange (tp_missing);
+ }
+ }
+ }
+
if (missing != null || BaseType == null)
return missing;
}
}
+ //
+ // Special version used for types which must exist in corlib or
+ // the compiler cannot work
+ //
public sealed class BuiltinTypeSpec : TypeSpec
{
public enum Type
}
}
+ //
+ // Various type comparers used by compiler
+ //
static class TypeSpecComparer
{
//
if (!IsEqual (a.Types[i], b.Types[i]))
return false;
- const Parameter.Modifier ref_out = Parameter.Modifier.REF | Parameter.Modifier.OUT;
- if ((a.FixedParameters[i].ModFlags & ref_out) != (b.FixedParameters[i].ModFlags & ref_out))
+ if ((a.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask) != (b.FixedParameters[i].ModFlags & Parameter.Modifier.RefOutMask))
return false;
}
{
IAssemblyDefinition DeclaringAssembly { get; }
string Namespace { get; }
+ bool IsPartial { get; }
int TypeParametersCount { get; }
TypeParameterSpec[] TypeParameters { get; }
readonly string name;
- InternalType (string name, MemberCache cache)
- : this (name)
- {
- this.cache = cache;
- }
-
InternalType (string name)
: base (MemberKind.InternalCompilerType, null, null, null, Modifiers.PUBLIC)
{
cache = MemberCache.Empty;
// Make all internal types CLS-compliant, non-obsolete
- state = (state & ~(StateFlags.CLSCompliant_Undetected | StateFlags.Obsolete_Undetected)) | StateFlags.CLSCompliant;
+ state = (state & ~(StateFlags.CLSCompliant_Undetected | StateFlags.Obsolete_Undetected | StateFlags.MissingDependency_Undetected)) | StateFlags.CLSCompliant;
}
#region Properties
}
}
+ bool ITypeDefinition.IsPartial {
+ get {
+ return false;
+ }
+ }
+
public override string Name {
get {
return name;
#endregion
}
+ //
+ // Common base class for composite types
+ //
public abstract class ElementTypeSpec : TypeSpec, ITypeDefinition
{
protected ElementTypeSpec (MemberKind kind, TypeSpec element, MetaType info)
{
this.Element = element;
- // Some flags can be copied directly from the element
- const StateFlags shared_flags = StateFlags.CLSCompliant | StateFlags.CLSCompliant_Undetected
- | StateFlags.Obsolete | StateFlags.Obsolete_Undetected | StateFlags.HasDynamicElement;
- state &= ~shared_flags;
- state |= (element.state & shared_flags);
+ state &= ~SharedStateFlags;
+ state |= (element.state & SharedStateFlags);
if (element.BuiltinType == BuiltinTypeSpec.Type.Dynamic)
state |= StateFlags.HasDynamicElement;
public TypeSpec Element { get; private set; }
+ bool ITypeDefinition.IsPartial {
+ get {
+ return false;
+ }
+ }
+
public override string Name {
get {
throw new NotSupportedException ();