-
Notifications
You must be signed in to change notification settings - Fork 175
Updated to Roslyn 3.0.0 beta2 (C# 8) #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
I guess the #nullable enable
pragma works in scripts as well
Do we need to include <LangVersion>8.0</LangVersion>
in the generated csproj file?
https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/nullable-reference-types
There is a new option on the |
The only issue with a command line arg is that we need to decide what to put in the How is this on the OmniSharp side of things? Does it show squiggles if you use the pragma? |
Can the language version be set in |
// this is not needed once Roslyn 3.0 stable ships | ||
var csharpScriptCompilerType = typeof(CSharpScript).GetTypeInfo().Assembly.GetType("Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScriptCompiler"); | ||
var parseOptionsField = csharpScriptCompilerType?.GetField("s_defaultOptions", BindingFlags.Static | BindingFlags.NonPublic); | ||
parseOptionsField?.SetValue(null, new CSharpParseOptions(LanguageVersion.CSharp8, kind: SourceCodeKind.Script)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this execute before
https://github.com/filipw/dotnet-script/blob/cf01f703499220b3bc48ef329d3458dccb4af40f/src/Dotnet.Script.Core/Interactive/InteractiveRunner.cs#L30
Maybe we should add a nullable type test for the REPL too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no way to make nullable work yet because it only emits warnings and we swallow warnings at the moment. we also don't expose the ability to treat warnings as errors. I will open a separate issue to handle that
LGTM |
We can release it as a prerelease version since the latest Roslyn is available as beta on Nuget.