internal void Emit(CILMethodSignature methodSig, Tuple <CILCustomModifier[], CILTypeBase>[] varArgs) { this.BeforeEmittingOpCode(); this.EmitOpCode(OpCodes.Calli); this.UpdateStackSize(OpCodes.Calli, methodSig, varArgs); this.AddInt32(this._metaData.GetSignatureTokenFor(methodSig, varArgs)); }
/// <summary> /// Creates a new instance of <see cref="OpCodeInfoWithMethodSig"/> with specified values. /// </summary> /// <param name="methodSig">The <see cref="CILMethodSignature"/>.</param> /// <param name="varArgs">The variable arguments for this call site. May be <c>null</c> or empty for non-varargs call.</param> /// <exception cref="ArgumentNullException">If <paramref name="methodSig"/> is <c>null</c>.</exception> public OpCodeInfoWithMethodSig(CILMethodSignature methodSig, Tuple <CILCustomModifier[], CILTypeBase>[] varArgs) : base(OpCodes.Calli, false) { ArgumentValidator.ValidateNotNull("Method signature", methodSig); this._methodSig = methodSig; this._varArgs = varArgs; }
internal CILParameterSignatureImpl(CILReflectionContext ctx, CILMethodSignature method, Int32 position, CILTypeBase pType, ListProxy <CILCustomModifier> mods) : base(ctx) { ArgumentValidator.ValidateNotNull("Method", method); ArgumentValidator.ValidateNotNull("Parameter type", pType); this._mods = (mods ?? this._ctx.CollectionsFactory.NewListProxy <CILCustomModifier>()).CQ; this._method = method; this._position = position; this._pType = pType; }
/// <summary> /// Checks whether method signature contains generic parameters. /// </summary> /// <param name="method">The method to check.</param> /// <returns><c>true</c> if method is non-<c>null</c> and contains any unassigned generic type parameters; <c>false</c> otherwise.</returns> /// <seealso cref="System.Reflection.MethodBase.ContainsGenericParameters"/> /// <remarks> /// Method signature contains generic parameters when any of the following is true: /// <list type="bullet"> /// <item><description>the parameter type of the method signature return parameter contains generic parameters, or</description></item> /// <item><description>any of the parameter types of the parameters of the method signature contain generic parameters.</description></item> /// </list> /// </remarks> public static Boolean ContainsGenericParameters(this CILMethodSignature method) { return(method != null && (method.ReturnParameter.ParameterType.ContainsGenericParameters() || method.Parameters.Any(p => p.ParameterType.ContainsGenericParameters()))); }