in sdk/Sdk.Analyzers/BindingTypeNotSupported.cs [49:81]
private static void AnalyzeParameter(SymbolAnalysisContext context, IParameterSymbol parameter)
{
foreach (var attribute in parameter.GetAttributes())
{
var attributeType = attribute?.AttributeClass;
if (!attributeType.IsInputOrTriggerBinding())
{
continue;
}
var inputConverterAttributes = attributeType.GetInputConverterAttributes(context.Compilation);
if (inputConverterAttributes.Count <= 0)
{
continue;
}
var converterFallbackBehaviorParameterValue = (int)GetConverterFallbackBehaviorParameterValue(context, attributeType);
if (converterFallbackBehaviorParameterValue == ConverterFallbackBehaviorDefaultValue)
{
// If the ConverterFallbackBehavior is Allow or Default (enum value 0), we don't need to check for supported types
// because we don't know all of the types that are supported via the fallback
continue;
}
var supportedTypes = GetSupportedTypes(context, inputConverterAttributes);
if (supportedTypes.Count <= 0 || supportedTypes.Contains(parameter.Type))
{
continue;
}
ReportDiagnostic(context, parameter, attributeType);
}
}