Skip to content

Commit 90249c1

Browse files
committed
First pass F# 9 support
1 parent e72eff3 commit 90249c1

File tree

17 files changed

+45
-37
lines changed

17 files changed

+45
-37
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"paket": {
6-
"version": "8.0.3",
6+
"version": "9.0.2",
77
"commands": [
88
"paket"
99
],

.vscode/settings.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{
22
"editor.inlayHints.enabled": "off",
33
"FSharp.enableMSBuildProjectGraph": true,
4-
"editor.formatOnSave": true,
4+
"[fsharp]": {
5+
"editor.formatOnSave": true,
6+
},
57
"FSharp.notifications.trace": false,
68
"FSharp.notifications.traceNamespaces": [
79
"BoundModel.TypeCheck",
810
"BackgroundCompiler."
911
],
1012
"FSharp.fsac.parallelReferenceResolution": false,
1113
"FSharp.enableAnalyzers": true,
12-
"FSharp.analyzersPath": ["packages/analyzers"]
13-
}
14+
"FSharp.analyzersPath": [
15+
"packages/analyzers"
16+
]
17+
}

Directory.Build.props

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
<Project>
22
<PropertyGroup>
33
<DisableCheckingDuplicateNuGetItems>true</DisableCheckingDuplicateNuGetItems>
4-
<NoWarn>$(NoWarn);FS2003; NU1903; NU1904</NoWarn>
4+
<NoWarn>$(NoWarn);FS2003;NU1903;NU1904;FS0057</NoWarn>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
66
<WarningsAsErrors />
7+
<!--
8+
Changing the LangVersion based on TFM because F# 9 brings in new features that older SDK's can't support.
9+
See https://github.com/dotnet/fsharp/issues/14313 for an example.
10+
To keep this library as backward compatible as possible we're setting the LangVersion to 8.0 by default.
11+
Then, we're assuming if you're building for net9.0 you're using F# 9 Language features.
12+
-->
13+
<LangVersion>8.0</LangVersion>
14+
<LangVersion Condition="'$(TargetFramework)' == 'net9.0'">9.0</LangVersion>
15+
<PaketPropsVersion>6.0.0</PaketPropsVersion> <!-- Hack to prevent paket from restoring when it should not -->
716
</PropertyGroup>
817
</Project>

Directory.Solution.targets

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<Project>
2-
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences">
3-
<Exec Command="dotnet tool restore" StandardOutputImportance="High"
4-
StandardErrorImportance="High" />
2+
<PropertyGroup>
3+
<_BuildProjBaseIntermediateOutputPath>$(MSBuildThisFileDirectory)build/obj/</_BuildProjBaseIntermediateOutputPath>
4+
<_DotnetToolManifestFile>$(MSBuildThisFileDirectory).config/dotnet-tools.json</_DotnetToolManifestFile>
5+
<_DotnetToolRestoreOutputFile>$(_BuildProjBaseIntermediateOutputPath)/dotnet-tool-restore-$(NETCoreSdkVersion)-$(OS)</_DotnetToolRestoreOutputFile>
6+
</PropertyGroup>
7+
8+
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences;PaketRestore" Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
9+
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" />
10+
<MakeDir Directories="$(_BuildProjBaseIntermediateOutputPath)"/>
11+
<Touch Files="$(_DotnetToolRestoreOutputFile)" AlwaysCreate="True" ForceTouch="True" />
512
</Target>
613
</Project>

benchmarks/benchmarks.fsproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
55
<OutputType>Exe</OutputType>
6-
<LangVersion>preview</LangVersion>
76
</PropertyGroup>
87
<PropertyGroup>
98
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -14,9 +13,6 @@
1413
<IsPackable>false</IsPackable>
1514
<NoWarn>FS1204;FS3501;FS3511</NoWarn>
1615
</PropertyGroup>
17-
<PropertyGroup Condition="'$(Configuration)'=='Release'">
18-
<Tailcalls>true</Tailcalls>
19-
</PropertyGroup>
2016
<ItemGroup>
2117
<Compile Include="SeqTests.fs" />
2218
<Compile Include="ApplicativeTests.fs" />
@@ -28,7 +24,8 @@
2824
<Compile Include="Program.fs" />
2925
</ItemGroup>
3026
<ItemGroup>
31-
<ProjectReference Include="..\src\FsToolkit.ErrorHandling.JobResult\FsToolkit.ErrorHandling.JobResult.fsproj" />
27+
<ProjectReference
28+
Include="..\src\FsToolkit.ErrorHandling.JobResult\FsToolkit.ErrorHandling.JobResult.fsproj" />
3229
</ItemGroup>
3330
<Import Project="..\.paket\Paket.Restore.targets" />
3431
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "9.0.100",
44
"rollForward": "latestMinor"
55
}
66
}

src/Directory.Build.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
</PropertyGroup>
2424

2525
<PropertyGroup>
26-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
27-
<WarningsAsErrors />
28-
<NoWarn>FS2003</NoWarn>
26+
<NoWarn>$(NoWarn);FS2003</NoWarn>
2927
</PropertyGroup>
3028
</Project>

src/FsToolkit.ErrorHandling.AsyncSeq/FsToolkit.ErrorHandling.AsyncSeq.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
6-
<LangVersion>preview</LangVersion>
5+
<TargetFrameworks>netstandard2.1;netstandard2.0;net9.0</TargetFrameworks>
6+
77
<DebugType>portable</DebugType>
88
</PropertyGroup>
99
<!-- Add source files to "fable" folder in Nuget package -->

src/FsToolkit.ErrorHandling.IcedTasks/FsToolkit.ErrorHandling.IcedTasks.fsproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1</TargetFrameworks>
6-
<LangVersion>preview</LangVersion>
5+
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1;net9.0</TargetFrameworks>
6+
77
<DebugType>portable</DebugType>
8-
<NoWarn>FS3511;FS3513</NoWarn>
8+
<NoWarn>$(NoWarn);FS3511;FS3513</NoWarn>
99
</PropertyGroup>
1010
<ItemGroup>
1111
<Compile Include="CancellableTaskResultBuilderBase.fs" />

src/FsToolkit.ErrorHandling.JobResult/FsToolkit.ErrorHandling.JobResult.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.1;netstandard2.0;net9.0</TargetFrameworks>
66
<DebugType>portable</DebugType>
77
</PropertyGroup>
88
<ItemGroup>

0 commit comments

Comments
 (0)