Skip generating for generic shader types, and warn

このコミットが含まれているのは:
Sergio Pedri committed 2023-11-26 16:35:20 +01:00
1 親 4df52a9e40
コミット bf7c470cb3
6ファイル変更
+26 -18

検索条件に一致するファイルはありません

@@ -38,9 +38,14 @@ public sealed class InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnaly
return;
}
// Emit a diagnostic if the target type is using [D2DGeneratedPixelShaderDescriptor] but does not implement ID2D1PixelShader
if (typeSymbol.TryGetAttributeWithType(d2DGeneratedPixelShaderDescriptorAttributeSymbol, out AttributeData? attribute) &&
!typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol))
// If the type does not have [D2DGeneratedPixelShaderDescriptor], we can stop here
if (!typeSymbol.TryGetAttributeWithType(d2DGeneratedPixelShaderDescriptorAttributeSymbol, out AttributeData? attribute))
{
return;
}
// Emit a diagnostic if the target type is generic or does not implement ID2D1PixelShader
if (typeSymbol.IsGenericType || !typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol))
{
context.ReportDiagnostic(Diagnostic.Create(
InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget,