Skip to content

Commit

Permalink
cap to max available version
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperk81 committed Nov 7, 2024
1 parent c301f01 commit affca81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Compilers/Core/MSBuildTask/Microsoft.CSharp.Core.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<_MaxSupportedLangVersion Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND
'$(_MaxSupportedLangVersion)' == ''">$([MSBuild]::Add(9, $([MSBuild]::Subtract($(_TargetFrameworkVersionWithoutV), 5)))).0</_MaxSupportedLangVersion>

<!-- Cap _MaxSupportedLangVersion if it exceeds _MaxAvailableLangVersion -->
<_MaxAvailableLangVersion>13.0</_MaxAvailableLangVersion>
<_MaxSupportedLangVersion Condition="$(_MaxSupportedLangVersion) &gt; $(_MaxAvailableLangVersion)">$(_MaxAvailableLangVersion)</_MaxSupportedLangVersion>

<MaxSupportedLangVersion>$(_MaxSupportedLangVersion)</MaxSupportedLangVersion>
<LangVersion Condition="'$(LangVersion)' == '' AND '$(_MaxSupportedLangVersion)' != ''">$(_MaxSupportedLangVersion)</LangVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/Core/MSBuildTaskTests/TargetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public void GenerateEditorConfigCoreHandlesMalformedCompilerVisibleItemMetadata(
[InlineData(".NETCoreApp", "7.0", "11.0")]
[InlineData(".NETCoreApp", "8.0", "12.0")]
[InlineData(".NETCoreApp", "9.0", "13.0")]
[InlineData(".NETCoreApp", "10.0", "14.0")]
[InlineData(".NETCoreApp", "10.0", "13.0")] // update when 14.0 is released

[InlineData(".NETStandard", "1.0", "7.3")]
[InlineData(".NETStandard", "1.5", "7.3")]
Expand Down

0 comments on commit affca81

Please sign in to comment.