Enable C# 8.0 in the code base
This change enables C# 8.0 use in the code base as well as moving the recommended Visual Studio version to 2019 Preview 4. The following features are now allowed to be used: - `switch` expressions - recursive pattern matching - `using` declarations - `static` local functions - local / parameter shadowing in local functions / lambdas - `null` coalescing assignment - `async` streams: keep this out of our public API surface for now as we don't want to block unification with netcoreapp in the future. Before getting into the features which are off limits I wanted to outline how compiler toolsets work in this repository. There are three toolsets we need to consider when adopting new features: 1. The compiler toolset which provides the IDE experience: Intellisense, syntax highlighting, etc ... 1. The compiler toolset which is used when the solution is built. This is explicitly different than the compiler toolset which ships with the MSBuild driving the compilation. 1. The compiler toolset is built from source on every PR and used as the toolset for the PR (overriding 2 above). That being said the following features are offlimit for now: - Index / Range: the API surface area, including the parts the compiler depends on, underwent significant churn for .NET Core Preview 3. Until we converge it means toolsets 1 and 2 can be a bit out of sync. - `unmanaged` generic `struct`: this is not included in VS2019 Preview 4 and hence using it would make the IDE experience poor. - Nullable Reference Types: this area is under active churn and we could easily get into a situation where toolsets 2 and 3 disagreed on code checked into the repository creating unmergeable PRs. As such we're holding off on this in master for now. Until then please use the branch [features/NullableDogfood](https://github.com/dotnet/roslyn/tree/features/NullableDogfood) to dogfood NRT. This will be merged back into master closer to Dev16.0GA. Note: This change only affects the C# compiler toolset. There are no changes to our MSBuild or .NET Core SDK toolsets. Those will be coming soonish though.
Showing
想要评论请 注册 或 登录