private void Add(GenericInstMethodSig sig) { if (sig == null) { return; } Add(sig.GenericArguments); }
private void Add(GenericInstMethodSig gsig) { if (gsig == null) { return; } Add(gsig.ExtraData); Add(gsig.GenericArguments); }
private bool ContainsGenericParameterInternal(GenericInstMethodSig gim) { if (gim == null) { return(false); } if (!recursionCounter.Increment()) { return(false); } bool res = ContainsGenericParameter(gim.GenericArguments); recursionCounter.Decrement(); return(res); }
/// <summary> /// Reads a <see cref="GenericInstMethodSig"/> /// </summary> /// <param name="callingConvention">First byte of signature</param> /// <returns>A new <see cref="GenericInstMethodSig"/> instance</returns> private GenericInstMethodSig ReadGenericInstMethod(CallingConvention callingConvention) { uint count; if (!reader.ReadCompressedUInt32(out count)) { return(null); } var sig = new GenericInstMethodSig(callingConvention, count); var args = sig.GenericArguments; for (uint i = 0; i < count; i++) { args.Add(ReadType()); } return(sig); }
/// <summary> /// Gets the generic arguments /// </summary> /// <param name="sig">this</param> /// <returns>All generic arguments</returns> public static IList <TypeSig> GetGenericArguments(this GenericInstMethodSig sig) { return(sig == null?ThreadSafeListCreator.Create <TypeSig>() : sig.GenericArguments); }
/// <summary> /// Constructor /// </summary> /// <param name="method">The generic method</param> /// <param name="sig">The instantiated method sig</param> public MethodSpecUser(IMethodDefOrRef method, GenericInstMethodSig sig) { this.method = method; this.instantiation = sig; }
/// <summary> /// Checks whether <paramref name="gim"/> contains a <see cref="GenericVar"/> or a /// <see cref="GenericMVar"/>. /// </summary> /// <param name="gim">Generic method signature</param> /// <returns><c>true</c> if <paramref name="gim"/> contains a <see cref="GenericVar"/> /// or a <see cref="GenericMVar"/>.</returns> public static bool ContainsGenericParameter(GenericInstMethodSig gim) { return(new TypeHelper().ContainsGenericParameterInternal(gim)); }