|
|
@ -209,13 +209,14 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation |
|
|
|
MetadataModule module, IParameterizedMember owner, |
|
|
|
MetadataModule module, IParameterizedMember owner, |
|
|
|
MethodSignature<IType> signature, ParameterHandleCollection? parameterHandles, |
|
|
|
MethodSignature<IType> signature, ParameterHandleCollection? parameterHandles, |
|
|
|
Nullability nullableContext, TypeSystemOptions typeSystemOptions, |
|
|
|
Nullability nullableContext, TypeSystemOptions typeSystemOptions, |
|
|
|
CustomAttributeHandleCollection? returnTypeAttributes = null) |
|
|
|
CustomAttributeHandleCollection? additionalReturnTypeAttributes = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var metadata = module.metadata; |
|
|
|
var metadata = module.metadata; |
|
|
|
int i = 0; |
|
|
|
int i = 0; |
|
|
|
IParameter[] parameters = new IParameter[signature.RequiredParameterCount |
|
|
|
IParameter[] parameters = new IParameter[signature.RequiredParameterCount |
|
|
|
+ (signature.Header.CallingConvention == SignatureCallingConvention.VarArgs ? 1 : 0)]; |
|
|
|
+ (signature.Header.CallingConvention == SignatureCallingConvention.VarArgs ? 1 : 0)]; |
|
|
|
IType parameterType; |
|
|
|
IType parameterType; |
|
|
|
|
|
|
|
CustomAttributeHandleCollection? returnTypeAttributes = null; |
|
|
|
if (parameterHandles != null) |
|
|
|
if (parameterHandles != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (var parameterHandle in parameterHandles) |
|
|
|
foreach (var parameterHandle in parameterHandles) |
|
|
@ -225,14 +226,13 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation |
|
|
|
{ |
|
|
|
{ |
|
|
|
// "parameter" holds return type attributes.
|
|
|
|
// "parameter" holds return type attributes.
|
|
|
|
// Note: for properties, the attributes normally stored on a method's return type
|
|
|
|
// Note: for properties, the attributes normally stored on a method's return type
|
|
|
|
// are instead stored as normal attributes on the property.
|
|
|
|
// are instead typically stored as normal attributes on the property.
|
|
|
|
// So MetadataProperty provides a non-null value for returnTypeAttributes,
|
|
|
|
// So MetadataProperty provides a non-null value for additionalReturnTypeAttributes,
|
|
|
|
// which then should be preferred over the attributes on the accessor's parameters.
|
|
|
|
// which then will be preferred over the attributes on the accessor's parameters.
|
|
|
|
if (returnTypeAttributes == null) |
|
|
|
// However if an attribute only exists on the accessor's parameters, we still want
|
|
|
|
{ |
|
|
|
// to process it here.
|
|
|
|
returnTypeAttributes = par.GetCustomAttributes(); |
|
|
|
returnTypeAttributes = par.GetCustomAttributes(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (i < par.SequenceNumber && par.SequenceNumber <= signature.RequiredParameterCount) |
|
|
|
else if (i < par.SequenceNumber && par.SequenceNumber <= signature.RequiredParameterCount) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// "Successive rows of the Param table that are owned by the same method shall be
|
|
|
|
// "Successive rows of the Param table that are owned by the same method shall be
|
|
|
|