C# Class Pchp.CodeAnalysis.Symbols.PE.MemberRefMetadataDecoder

This subclass of MetadataDecoder is specifically for finding method symbols corresponding to method MemberRefs. The parent implementation is unsuitable because it requires a PEMethodSymbol for context when decoding method type parameters and no such context is available because it is precisely what we are trying to find. Since we know in advance that there will be no context and that signatures decoded with this class will only be used for comparison (when searching through the methods of a known TypeSymbol), we can return indexed type parameters instead.
Inheritance: MetadataDecoder
Mostra file Open project: iolevel/peachpie

Public Methods

Method Description
MemberRefMetadataDecoder ( PEModuleSymbol moduleSymbol, TypeSymbol containingType ) : Microsoft.CodeAnalysis

Protected Methods

Method Description
GetGenericMethodTypeParamSymbol ( int position ) : TypeSymbol

We know that we'll never have a method context because that's what we're trying to find. Instead, just return an indexed type parameter that will make comparison easier.

GetGenericTypeParamSymbol ( int position ) : TypeSymbol

This override changes two things: 1) Return type arguments instead of type parameters. 2) Handle non-PE types.

Private Methods

Method Description
CustomModifiersMatch ( ImmutableArray candidateCustomModifiers, ImmutableArray targetCustomModifiers ) : bool
FindFieldBySignature ( TypeSymbol targetTypeSymbol, string targetMemberName, ImmutableArray customModifiers, TypeSymbol type ) : FieldSymbol
FindMember ( TypeSymbol targetTypeSymbol, MemberReferenceHandle memberRef, bool methodsOnly ) : Symbol

Search through the members of a given type symbol to find the method that matches a particular signature.

FindMethodBySignature ( TypeSymbol targetTypeSymbol, string targetMemberName, SignatureHeader targetMemberSignatureHeader, int targetMemberTypeParamCount, ParamInfo targetParamInfo ) : MethodSymbol
GetGenericTypeArgumentSymbol ( int position, NamedTypeSymbol namedType, int &cumulativeArity, TypeSymbol &typeArgument ) : void
MethodSymbolMatchesParamInfo ( MethodSymbol candidateMethod, ParamInfo targetParamInfo ) : bool
ParametersMatch ( ParameterSymbol candidateParam, TypeMap candidateMethodTypeMap, ParamInfo &targetParam ) : bool
ReturnTypesMatch ( MethodSymbol candidateMethod, TypeMap candidateMethodTypeMap, ParamInfo &targetReturnParam ) : bool

Method Details

GetGenericMethodTypeParamSymbol() protected method

We know that we'll never have a method context because that's what we're trying to find. Instead, just return an indexed type parameter that will make comparison easier.
protected GetGenericMethodTypeParamSymbol ( int position ) : TypeSymbol
position int
return TypeSymbol

GetGenericTypeParamSymbol() protected method

This override changes two things: 1) Return type arguments instead of type parameters. 2) Handle non-PE types.
protected GetGenericTypeParamSymbol ( int position ) : TypeSymbol
position int
return TypeSymbol

MemberRefMetadataDecoder() public method

public MemberRefMetadataDecoder ( PEModuleSymbol moduleSymbol, TypeSymbol containingType ) : Microsoft.CodeAnalysis
moduleSymbol PEModuleSymbol
containingType TypeSymbol
return Microsoft.CodeAnalysis