@@ -213,7 +213,7 @@ private void CheckArguments(SymbolAnalysisContext context, AttributeData argumen
213213 var argument = arguments . ElementAtOrDefault ( i ) ;
214214
215215 if ( typeSymbol . IsCollectionType ( context . Compilation , out var innerType )
216- && arguments . Skip ( i ) . Select ( x => x . Type ) . All ( x => SymbolEqualityComparer . Default . Equals ( x , innerType ) ) )
216+ && arguments . Skip ( i ) . Select ( x => x . Type ) . All ( x => CanConvert ( context , x , innerType ) ) )
217217 {
218218 break ;
219219 }
@@ -596,17 +596,22 @@ private static bool CanConvert(SymbolAnalysisContext context, TypedConstant argu
596596 return true ;
597597 }
598598
599- if ( argument . Type is not null
599+ return CanConvert ( context , argument . Type , methodParameterType ) ;
600+ }
601+
602+ private static bool CanConvert ( SymbolAnalysisContext context , ITypeSymbol ? argumentType , ITypeSymbol ? methodParameterType )
603+ {
604+ if ( argumentType is not null
600605 && methodParameterType is not null
601- && context . Compilation . ClassifyConversion ( argument . Type , methodParameterType )
606+ && context . Compilation . ClassifyConversion ( argumentType , methodParameterType )
602607 is { IsImplicit : true }
603608 or { IsExplicit : true }
604609 or { IsNumeric : true } )
605610 {
606611 return true ;
607612 }
608613
609- return context . Compilation . HasImplicitConversionOrGenericParameter ( argument . Type , methodParameterType ) ;
614+ return context . Compilation . HasImplicitConversionOrGenericParameter ( argumentType , methodParameterType ) ;
610615 }
611616
612617 private bool IsEnumAndInteger ( ITypeSymbol ? type1 , ITypeSymbol ? type2 )
0 commit comments