chore: Update LangVersion to 14 #2875
Open
+39
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR update
LangVersionfrom12to14.After this PR is merged.
BenchmarkDotNet source build requires .NET 10 SDK.
Other changes
1.
build/sdk/global.jsonUpdate SDK version to
10.0.100to use LangVersion14.This setting seems also applied to unit tests. (By existing roll forward setting)
So by this change. tests app that build target
net80are executed under .NET 10 runtime.2.
src/BenchmarkDotNet/Code/DeclarationsProvider.csRename
fieldvariable name tofieldInfoto fix build error that occurred when usingfieldproperty name on C# 14.3.
build\BenchmarkDotNet.Build\Program.csAdd steps to install
wasm-tools-net8workload.When build .NET 8 WASM project with .NET SDK 10.
It need to install additional workload.
https://learn.microsoft.com/en-us/aspnet/core/blazor/webassembly-build-tools-and-aot?view=aspnetcore-10.0#net-webassembly-build-tools
4.
tests/BenchmarkDotNet.IntegrationTests/NugetReferenceTests.csWhen build project with .NET 10 SDK.
System.Collection.Immutablepackage is pruned and resolved to SDK version assembly.So I've added code for custom comparison.
5.
tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cstests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cstests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cstests/BenchmarkDotNet.Tests/Helpers/DotNetRuntimeHelper.csModify assertion logics to support environment that using
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2.