#nullable added to auto-generated sources to allow compilations with nullability check enabled.
This commit is contained in:
1 parent
9faa397364
commit
0b226c76e8
2 files changed
+4
-2
No files matched your search
@@ -163,7 +163,9 @@ public sealed class DeviceDependentGenerator : IIncrementalGenerator
|
||||
|
||||
string generatedFileName = baseName + "." + enumValueName + ".generated.cs";
|
||||
string hintName = options.BuildHintName(filePath, generatedFileName);
|
||||
context.AddSource(hintName, SourceText.From(generatedRoot.ToFullString(), Encoding.UTF8));
|
||||
context.AddSource(
|
||||
hintName,
|
||||
SourceText.From("// <auto-generated/>\n#nullable enable\n" + generatedRoot.ToFullString(), Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
|
||||
Reference in new issue
Block a user