Update NuGet packages

This commit is contained in:
Tyrrrz
2023-11-12 19:08:54 +02:00
parent ff06b8896f
commit b41e9b4929
33 changed files with 149 additions and 112 deletions

View File

@@ -29,12 +29,14 @@ public class ParameterMustHaveValidConverterAnalyzer : AnalyzerBase
if (parameter.ConverterType is null)
return;
var converterValueType = parameter.ConverterType
var converterValueType = parameter
.ConverterType
.GetBaseTypes()
.FirstOrDefault(
t => t.ConstructedFrom.DisplayNameMatches(SymbolNames.CliFxBindingConverterClass)
)
?.TypeArguments.FirstOrDefault();
?.TypeArguments
.FirstOrDefault();
// Value returned by the converter must be assignable to the property type
var isCompatible =
@@ -45,10 +47,9 @@ public class ParameterMustHaveValidConverterAnalyzer : AnalyzerBase
? context.Compilation.IsAssignable(converterValueType, property.Type)
// Non-scalar (assume we can handle all IEnumerable types for simplicity)
: property.Type.TryGetEnumerableUnderlyingType() is { } enumerableUnderlyingType
&& context.Compilation.IsAssignable(
converterValueType,
enumerableUnderlyingType
)
&& context
.Compilation
.IsAssignable(converterValueType, enumerableUnderlyingType)
);
if (!isCompatible)