@@ -100,12 +100,12 @@ private static FilterMatch TryGetMember(IMethodSymbol getX, ITypeSymbol type, Na
100100 {
101101 foreach ( var candidate in type . GetMembers ( ) )
102102 {
103- if ( ! MatchesFilter ( candidate , name , flags , types ) )
103+ if ( ! MatchesFilter ( candidate , compilation , name , flags , types ) )
104104 {
105105 continue ;
106106 }
107107
108- if ( types . TryMostSpecific ( member , candidate , out member ) )
108+ if ( types . TryMostSpecific ( member , candidate , compilation , out member ) )
109109 {
110110 isAmbiguous = false ;
111111 if ( IsWrongMemberType ( member ) )
@@ -126,7 +126,7 @@ private static FilterMatch TryGetMember(IMethodSymbol getX, ITypeSymbol type, Na
126126 {
127127 foreach ( var candidate in current . GetMembers ( ) )
128128 {
129- if ( ! MatchesFilter ( candidate , name , flags , types ) )
129+ if ( ! MatchesFilter ( candidate , compilation , name , flags , types ) )
130130 {
131131 continue ;
132132 }
@@ -136,7 +136,7 @@ private static FilterMatch TryGetMember(IMethodSymbol getX, ITypeSymbol type, Na
136136 continue ;
137137 }
138138
139- if ( types . TryMostSpecific ( member , candidate , out member ) )
139+ if ( types . TryMostSpecific ( member , candidate , compilation , out member ) )
140140 {
141141 isAmbiguous = false ;
142142 if ( IsUseContainingType ( member ) )
@@ -182,7 +182,7 @@ private static FilterMatch TryGetMember(IMethodSymbol getX, ITypeSymbol type, Na
182182 return FilterMatch . Single ;
183183 }
184184
185- if ( type . TryFindFirstMemberRecursive ( x => MatchesFilter ( x , name , Flags . MatchAll . Effective , Types . Any ) , out member ) )
185+ if ( type . TryFindFirstMemberRecursive ( x => MatchesFilter ( x , compilation , name , Flags . MatchAll . Effective , Types . Any ) , out member ) )
186186 {
187187 if ( IsUseContainingType ( member ) )
188188 {
@@ -294,7 +294,7 @@ bool IsUseContainingType(ISymbol symbol)
294294 bool IsWrongFlags ( ISymbol symbol )
295295 {
296296 if ( symbol . MetadataName == name . MetadataName &&
297- ! MatchesFilter ( symbol , name , flags , Types . Any ) )
297+ ! MatchesFilter ( symbol , compilation , name , flags , Types . Any ) )
298298 {
299299 return true ;
300300 }
@@ -318,14 +318,14 @@ bool IsWrongTypes(ISymbol symbol)
318318
319319 const BindingFlags everything = BindingFlags . Public | BindingFlags . NonPublic | BindingFlags . Static | BindingFlags . Instance | BindingFlags . FlattenHierarchy ;
320320 return symbol . MetadataName == name . MetadataName &&
321- ! MatchesFilter ( symbol , name , everything , types ) ;
321+ ! MatchesFilter ( symbol , compilation , name , everything , types ) ;
322322 }
323323
324324 bool IsExplicitImplementation ( out ISymbol result )
325325 {
326326 foreach ( var @interface in type . AllInterfaces )
327327 {
328- if ( @interface . TryFindFirstMember ( x => MatchesFilter ( x , name , Flags . MatchAll . Effective , types ) , out result ! ) )
328+ if ( @interface . TryFindFirstMember ( x => MatchesFilter ( x , compilation , name , Flags . MatchAll . Effective , types ) , out result ! ) )
329329 {
330330 return true ;
331331 }
@@ -336,7 +336,7 @@ bool IsExplicitImplementation(out ISymbol result)
336336 }
337337 }
338338
339- private static bool MatchesFilter ( ISymbol candidate , Name name , BindingFlags flags , Types types )
339+ private static bool MatchesFilter ( ISymbol candidate , Compilation compilation , Name name , BindingFlags flags , Types types )
340340 {
341341 if ( candidate . MetadataName != name . MetadataName )
342342 {
@@ -371,7 +371,7 @@ when IsMember() &&
371371 {
372372 switch ( candidate )
373373 {
374- case IMethodSymbol method when ! types . Matches ( method . Parameters ) :
374+ case IMethodSymbol method when ! types . Matches ( method . Parameters , compilation ) :
375375 return false ;
376376 }
377377 }
0 commit comments