/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <param name="other">An object to compare with this object.</param> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> public override bool Equals(SigType other) { GenericInstSigType gist = other as GenericInstSigType; if (gist == null) { return(false); } // TEMP if (!base.Equals(other)) { return(false); } if (this.baseType != gist.baseType) { return(false); } if (!SigType.Equals(this.genericArguments, gist.genericArguments)) { return(false); } // END TEMP return(base.Equals(other) && this.baseType == gist.baseType && SigType.Equals(this.genericArguments, gist.genericArguments)); }
/// <summary> /// Initializes a new instance of the <see cref="CilGenericType"/> class. /// </summary> /// <param name="module">The module.</param> /// <param name="baseGenericType">Type of the base generic.</param> /// <param name="genericTypeInstanceSignature">The generic type instance signature.</param> /// <param name="token">The token.</param> /// <param name="typeModule">The type module.</param> public CilGenericType(ITypeModule module, RuntimeType baseGenericType, GenericInstSigType genericTypeInstanceSignature, Token token, ITypeModule typeModule) : base(module, token, baseGenericType.BaseType) { Debug.Assert(baseGenericType is CilRuntimeType); this.signature = genericTypeInstanceSignature; this.baseGenericType = baseGenericType as CilRuntimeType; base.Attributes = baseGenericType.Attributes; base.Namespace = baseGenericType.Namespace; if (this.baseGenericType.IsNested) { // TODO: find generic type ; } // TODO: if this is a nested types, add enclosing type(s) into genericArguments first this.genericArguments = signature.GenericArguments; base.Name = GetName(typeModule); ResolveMethods(); ResolveFields(); this.containsOpenGenericArguments = CheckContainsOpenGenericParameters(); }
public CilGenericType(RuntimeType type, IMetadataModule referencingModule, GenericInstSigType genericTypeInstanceSignature, ISignatureContext signatureContext) : base(type.Token, type.Module) { this.signature = genericTypeInstanceSignature; this.signatureContext = signatureContext; this.signatureModule = referencingModule; this.Methods = this.GetMethods(); this.Fields = this.GetFields(); }
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <param name="other">An object to compare with this object.</param> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> public override bool Equals(SigType other) { GenericInstSigType gist = other as GenericInstSigType; if (null == gist) { return(false); } return(base.Equals(other) && _baseType == gist._baseType && SigType.Equals(_genericArgs, gist._genericArgs)); }
public CilGenericType(IModuleTypeSystem moduleTypeSystem, RuntimeType genericType, GenericInstSigType genericTypeInstanceSignature) : base(moduleTypeSystem, genericType.Token) { this.signature = genericTypeInstanceSignature; this.genericArguments = signature.GenericArguments; this.genericType = genericType; base.Attributes = genericType.Attributes; this.Methods = this.GetMethods(); this.Fields = this.GetFields(); }