Disabled [SkipLocalsInit] generation on unsupported targets
このコミットが含まれているのは:
1 親
1e4b547c38
コミット
e69a0b5835
1ファイル変更
+3
-2
@@ -89,8 +89,9 @@ public sealed partial class IShaderGenerator : ISourceGenerator
|
||||
Literal("This method is not intended to be used directly by user code"))))))
|
||||
};
|
||||
|
||||
// Add [SkipLocalsInit] if the target project allows it
|
||||
if (context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true })
|
||||
// Add [SkipLocalsInit] if the target project allows it and can access it
|
||||
if (context.Compilation.Options is CSharpCompilationOptions { AllowUnsafe: true } &&
|
||||
context.Compilation.GetTypeByMetadataName("System.Runtime.CompilerServices.SkipLocalsInit") is not null)
|
||||
{
|
||||
attributes.Add(AttributeList(SingletonSeparatedList(Attribute(IdentifierName("global::System.Runtime.CompilerServices.SkipLocalsInit")))));
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする