Skip to content

Commit

Permalink
Support nullability.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel authored and daveaglick committed Dec 19, 2023
1 parent 462476b commit b1cc19c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Buildalyzer.Workspaces/AnalyzerResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ private static CompilationOptions CreateCompilationOptions(IAnalyzerResult analy
// language-specific code is in local functions, to prevent assembly loading failures when assembly for the other language is not available
if (languageName == LanguageNames.CSharp)
{
CompilationOptions CreateCSharpCompilationOptions() => new CSharpCompilationOptions(kind.Value);
Enum.TryParse(analyzerResult.GetProperty("Nullable"), ignoreCase: true, out NullableContextOptions nullable);

CompilationOptions CreateCSharpCompilationOptions() => new CSharpCompilationOptions(kind.Value, nullableContextOptions: nullable);

return CreateCSharpCompilationOptions();
}
Expand Down

0 comments on commit b1cc19c

Please sign in to comment.