Skip to content

Commit 00e076d

Browse files
authored
Use LangVersion=Preview (#48747)
1 parent 7cfdc73 commit 00e076d

File tree

7 files changed

+17
-1
lines changed

7 files changed

+17
-1
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<SdkSrcRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src'))</SdkSrcRoot>
3232
<PackageProjectUrl>https://github.com/dotnet/sdk</PackageProjectUrl>
3333
<PackageLicenseExpression>MIT</PackageLicenseExpression>
34-
<LangVersion>Latest</LangVersion>
34+
<LangVersion>Preview</LangVersion>
3535
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
3636
<DebugSymbols>true</DebugSymbols>
3737
<!-- Default to all packages generating a corresponding symbol package -->

src/Common/Polyfills.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace System.Linq
2+
{
3+
public static class CustomEnumerableExtensions
4+
{
5+
#if NET10_0_OR_GREATER
6+
public static IEnumerable<T> Reverse<T>(T[] array) => Enumerable.Reverse(array);
7+
#else
8+
public static IEnumerable<T> Reverse<T>(this T[] array) => Enumerable.Reverse(array);
9+
#endif
10+
}
11+
}

src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<Compile Include="..\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\**\*.cs" LinkBase="Microsoft.NET.Sdk.WorkloadManifestReader" />
3636
<Compile Include="..\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs" LinkBase="Microsoft.DotNet.SdkResolver" />
3737
<Compile Include="$(RepoRoot)src\Common\EnvironmentVariableNames.cs" LinkBase="Common" />
38+
<Compile Include="$(RepoRoot)src\Common\Polyfills.cs" LinkBase="Common" />
3839
<Compile Include="$(RepoRoot)src\Common\WorkloadFileBasedInstall.cs" LinkBase="Common" />
3940
<Compile Include="$(RepoRoot)src\Common\WorkloadSetVersion.cs" LinkBase="Common" />
4041
<Compile Include="$(RepoRoot)src\Cli\dotnet\Commands\Workload\InstallStateContents.cs" LinkBase="Cli" />

src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
<Compile Include="$(RepoRoot)src\Common\EnvironmentVariableNames.cs" LinkBase="Common" />
6161
<Compile Include="$(RepoRoot)src\Common\CliFolderPathCalculatorCore.cs" LinkBase="Common" />
62+
<Compile Include="$(RepoRoot)src\Common\Polyfills.cs" LinkBase="Common" />
6263
<Compile Include="$(RepoRoot)src\Common\WorkloadFileBasedInstall.cs" LinkBase="Common" />
6364
<Compile Include="$(RepoRoot)src\Common\WorkloadSetVersion.cs" LinkBase="Common" />
6465
</ItemGroup>

src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/Microsoft.NET.Sdk.WorkloadManifestReader.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<EmbeddedResource Update="**\*.resx" GenerateSource="true" Namespace="Microsoft.NET.Sdk.Localization" />
1111
<Compile Include="..\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs" />
1212
<Compile Include="$(RepoRoot)src\Common\EnvironmentVariableNames.cs" LinkBase="Common" />
13+
<Compile Include="$(RepoRoot)src\Common\Polyfills.cs" LinkBase="Common" />
1314
<Compile Include="$(RepoRoot)src\Common\WorkloadFileBasedInstall.cs" LinkBase="Common" />
1415
<Compile Include="$(RepoRoot)src\Common\WorkloadSetVersion.cs" LinkBase="Common" />
1516
<Compile Include="$(RepoRoot)src\Cli\dotnet\Commands\Workload\InstallStateContents.cs" LinkBase="Cli" />

src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<Compile Include="..\..\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs" LinkBase="WorkloadManifestReader" />
100100
<Compile Include="$(RepoRoot)src\Common\EnvironmentVariableNames.cs" LinkBase="Common" />
101101
<Compile Include="$(RepoRoot)src\Common\CliFolderPathCalculatorCore.cs" LinkBase="Common" />
102+
<Compile Include="$(RepoRoot)src\Common\Polyfills.cs" LinkBase="Common" />
102103
<Compile Include="$(RepoRoot)src\Common\WorkloadFileBasedInstall.cs" LinkBase="Common" />
103104
<Compile Include="$(RepoRoot)src\Common\WorkloadSetVersion.cs" LinkBase="Common" />
104105
<Compile Include="$(RepoRoot)src\Cli\dotnet\Commands\Workload\InstallStateContents.cs" LinkBase="Cli" />

test/Microsoft.NET.TestFramework/Microsoft.NET.TestFramework.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
<ItemGroup>
6464
<Compile Include="**\*.cs" Exclude="$(GlobalExclude)" />
65+
<Compile Include="$(RepoRoot)src\Common\Polyfills.cs" LinkBase="Common" />
6566
</ItemGroup>
6667

6768
<ItemGroup>

0 commit comments

Comments
 (0)