Skip to content

Commit 4779a8f

Browse files
authored
+ .net8 target framework and F# language version 8 (#573)
- Add: .net8 target framework for F#+ library - Update: F# language version to 8 - Fix: A unique overload for method 'DateTime' could not be determined - Fix: Indentation warnings that has turned into compilation error - Fix: Fable 3.7 runs with downgraded .net versions and target framework
1 parent 3c7ff41 commit 4779a8f

File tree

14 files changed

+24
-23
lines changed

14 files changed

+24
-23
lines changed

.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"fable": {
6-
"version": "4.1.4",
6+
"version": "4.5.0",
77
"commands": [
88
"fable"
99
]

.github/workflows/fable.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
run: git submodule update --init --recursive
1818
- name: Remove global json
1919
run: rm global.json
20+
- name: Set target framework to net6 instead of net8
21+
uses: Mudlet/xmlstarlet-action@master
22+
with:
23+
args: edit --inplace --update "/Project/PropertyGroup/TargetFrameworks" --value "netstandard2.0;netstandard2.1;net6.0" ./src/FSharpPlus/FSharpPlus.fsproj
2024
- name: Setup .NET Core
2125
uses: actions/setup-dotnet@v3
2226
with:
@@ -26,8 +30,11 @@ jobs:
2630
6.0.x
2731
- name: Restore tools
2832
run: dotnet tool restore
33+
- name: Create global.json
34+
working-directory: tests/FSharpPlusFable.Tests
35+
run: mv fable3-global.json global.json
2936
- name: Install fable
30-
run: dotnet tool install --global Fable --version 3.7.20
37+
run: dotnet tool install --global Fable --version 3.7.22
3138
- name: Use Node.js
3239
uses: actions/setup-node@v1
3340
with:
@@ -83,9 +90,6 @@ jobs:
8390
run: git submodule update --init --recursive
8491
- name: Remove global json
8592
run: rm global.json
86-
- name: Remove global json in subfolder
87-
run: rm global.json
88-
working-directory: tests/FSharpPlusFable.Tests
8993
- name: Setup .NET Core
9094
uses: actions/setup-dotnet@v3
9195
with:

src/FSharpPlus/FSharpPlus.fsproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
2222
<Configurations>Debug;Release;Fable;Fable3;Test</Configurations>
2323
<Platforms>AnyCPU</Platforms>
24-
<LangVersion>6.0</LangVersion>
24+
<LangVersion>8.0</LangVersion>
25+
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
26+
2527
<DefineConstants Condition=" '$(Configuration)' == 'Test'">$(DefineConstants);TEST_TRACE</DefineConstants>
2628
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
2729
<DefineConstants Condition=" '$(Configuration)' == 'Fable3'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_3</DefineConstants>
2830
<DefineConstants Condition=" '$(Configuration)' == 'Fable4'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_4</DefineConstants>
29-
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
31+
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
3032
<!--<OutputPath>..\..\bin</OutputPath>-->
3133
</PropertyGroup>
3234
<ItemGroup>

tests/FSharpPlus.Tests/FSharpPlus.Tests.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Platforms>AnyCPU</Platforms>
1313
<DefineConstants Condition=" '$(Configuration)' == 'Test'">$(DefineConstants);TEST_TRACE</DefineConstants>
1414
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
15-
<TargetFramework>net7.0</TargetFramework>
15+
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
1616
</PropertyGroup>
1717
<ItemGroup>
1818
<Compile Include="Helpers.fs" />

tests/FSharpPlus.Tests/General.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ module Memoization =
19451945

19461946
let f x = printfn "calculating"; effs.Add "f"; string x
19471947
let g x (y:string) z : uint32 = printfn "calculating"; effs.Add "g"; uint32 (x * int y + int z)
1948-
let h x y z = printfn "calculating"; effs.Add "h"; new System.DateTime (x, y, z)
1948+
let h (x: int) (y: int) (z: int) = printfn "calculating"; effs.Add "h"; new System.DateTime (x, y, z)
19491949
let sum2 (a:int) = printfn "calculating"; effs.Add "sum2"; (+) a
19501950
let sum3 a (b:int) c = printfn "calculating"; effs.Add "sum3"; a + b + c
19511951
let sum4 a b c d : int = printfn "calculating"; effs.Add "sum4"; a + b + c + d

tests/FSharpPlusFable.Tests/FSharpTests/General.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ let memoization = testList "Memoization" [
311311

312312
let f x = printfn "calculating"; effs.Add "f"; string x
313313
let g x (y:string) z : uint32 = printfn "calculating"; effs.Add "g"; uint32 (x * int y + int z)
314-
let h x y z = printfn "calculating"; effs.Add "h"; new System.DateTime (x, y, z)
314+
let h (x: int) (y: int) (z: int) = printfn "calculating"; effs.Add "h"; new System.DateTime (x, y, z)
315315
let sum2 (a:int) = printfn "calculating"; effs.Add "sum2"; (+) a
316316
let sum3 a (b:int) c = printfn "calculating"; effs.Add "sum3"; a + b + c
317317
let sum4 a b c d : int = printfn "calculating"; effs.Add "sum4"; a + b + c + d

tests/FSharpPlusFable.Tests/FSharpTests/General/Alternative.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@ let alternative = testList "Alternative" [
128128
#endif
129129
)
130130
#endif
131-
]
131+
]

tests/FSharpPlusFable.Tests/FSharpTests/General/Applicative.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ let applicative = testList "Applicative" [
115115
let r3 = lift2 (+) a3 b3
116116
Assert.AreEqual ("Here's the state SHere's the other state S", (ReaderT.run r3 "S" |> Async.RunSynchronously)))
117117
#endif
118-
]
118+
]

tests/FSharpPlusFable.Tests/FSharpTests/General/Collections.fs

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,5 @@ let collections = testList "Collections" [
261261

262262
let m = choose Some ((ofSeq :seq<_*_> -> Map<_,_>) (seq ["a", 1; "b", 2]))
263263
Assert.IsInstanceOf<Option<Map<string,int>>> (Some m))
264-
#endif
265-
]
264+
#endif
265+
]

tests/FSharpPlusFable.Tests/FSharpTests/General/Foldable.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,5 @@ let foldable = testList "Foldable" [
337337
equal None sb'
338338
())
339339
#endif
340-
]
340+
]
341341

tests/FSharpPlusFable.Tests/FSharpTests/General/Indexable.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,4 @@ let indexable = testList "Indexable" [
246246
SideEffects.are ["Using WrappedListD's FindSliceIndex"]
247247
equal i1 1)
248248
#endif
249-
]
249+
]

tests/FSharpPlusFable.Tests/FSharpTests/General/Monad.fs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ let monad = testList "Monad" [
9393
)
9494
#endif
9595

96-
]
96+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "sdk": { "version": "6.0.201", "rollForward": "latestFeature" } }

tests/FSharpPlusFable.Tests/global.json

-6
This file was deleted.

0 commit comments

Comments
 (0)