Skip to content

Commit

Permalink
Enable nullable context in C# compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
KubaZ2 committed Aug 19, 2024
1 parent 6d36047 commit cfc9913
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Bot/Sharp/Compilation/CSharpCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ public class CSharpCompiler : RoslynCompiler
private static readonly CSharpCompilationOptions _executableOptions = new(
outputKind: OutputKind.ConsoleApplication,
optimizationLevel: OptimizationLevel.Release,
allowUnsafe: true);
allowUnsafe: true,
nullableContextOptions: NullableContextOptions.Enable);

private static readonly CSharpCompilationOptions _libraryOptions = new(
outputKind: OutputKind.DynamicallyLinkedLibrary,
optimizationLevel: OptimizationLevel.Release,
allowUnsafe: true);
allowUnsafe: true,
nullableContextOptions: NullableContextOptions.Enable);

private static CSharpCompilationOptions GetOptions(SyntaxTree syntaxTree, CompilationOutput? output)
{
Expand Down

0 comments on commit cfc9913

Please sign in to comment.