Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/Fable.Compiler/ProjectCracker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,6 @@ let getFullProjectOpts (resolver: ProjectCrackerResolver) (opts: CrackerOptions)
let ignoredRefs =
HashSet
[
"FSharp.Core"
"WindowsBase"
"Microsoft.Win32.Primitives"
"Microsoft.VisualBasic"
Expand All @@ -1027,14 +1026,7 @@ let getFullProjectOpts (resolver: ProjectCrackerResolver) (opts: CrackerOptions)

let projRefs = projRefs |> List.map (fun p -> p.ProjectFile)

let otherOptions =
[|
yield! otherOptions
yield! dllRefs
// For some reason, in my tests it seems to work without the FSharp.Core reference
// but we add it just in case
yield "-r:" + typeof<FSharp.Collections.List<obj>>.Assembly.Location
|]
let otherOptions = [| yield! otherOptions; yield! dllRefs |]

let outputType =
match mainProj.OutputType with
Expand Down
16 changes: 16 additions & 0 deletions tests/Integration/Integration/data/taskNetstandard/TaskBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module TaskBuilder

open System.Threading.Tasks

let run shouldThrow : Task<Result<int, exn>> =
task {
let! value = Task.FromResult 42

try
if shouldThrow then
failwith "boom"

return Ok value
with error ->
return Error error
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

import { task } from "./fable_modules/fable-library-js.5.15.0/TaskBuilder.js";
import { fromResult } from "./fable_modules/fable-library-js.5.15.0/Task.js";
import { Exception } from "./fable_modules/fable-library-js.5.15.0/Util.js";
import { FSharpResult$2 } from "./fable_modules/fable-library-js.5.15.0/Result.js";

export function run(shouldThrow) {
const builder$0040 = task();
return builder$0040.Run(builder$0040.Delay(() => builder$0040.Bind(fromResult(42), (_arg) => builder$0040.TryWith(builder$0040.Delay(() => builder$0040.Combine(shouldThrow ? (((() => {
throw new Exception("boom");
})(), builder$0040.Zero())) : builder$0040.Zero(), builder$0040.Delay(() => builder$0040.Return(new FSharpResult$2(/* Ok */ 0, [_arg]))))), (_arg_1) => builder$0040.Return(new FSharpResult$2(/* Error */ 1, [_arg_1]))))));
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="TaskBuilder.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FSharp.Core" Version="6.0.0" />
</ItemGroup>

</Project>
Loading