Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.ComponentTests.ConstraintSolver

open Xunit
open FSharp.Test.Compiler

module TaskCETypeInference =

// https://github.com/dotnet/fsharp/issues/14596
[<Fact>]
let ``Issue 14596 - Type inference in backgroundTask CE should not produce FS0073`` () =
FSharp
"""
module UnresolvedTypeVarBug

type IMarker<'T> = interface end
type SomeAction<'T when 'T :> IMarker<'T>> = SomeAction of list<'T>
type Spec<'Action> = { Dummy: unit }

open System.Threading.Tasks

let dummyTask (_spec: Spec<'Action>) (_action: 'Action) : Task<Result<unit, string>> = failwith "not implemented"

let repro (spec: Spec<SomeAction<'T>>)
: Task<Result<unit, string>> =

backgroundTask {
let action = SomeAction []
let! res = dummyTask spec action

match res with
| Ok _ ->
return Ok ()
| Error err ->
return Error err
}
"""
|> asLibrary
|> typecheck
|> shouldSucceed
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@
<Compile Include="ConstraintSolver\PrimitiveConstraints.fs" />
<Compile Include="ConstraintSolver\MemberConstraints.fs" />
<Compile Include="ConstraintSolver\ObjInference.fs" />
<Compile Include="ConstraintSolver\TaskCETypeInference.fs" />
<Compile Include="Interop\DeeplyNestedCSharpClasses.fs" />
<Compile Include="Interop\DIMSlotCoverageTests.fs" />
<Compile Include="Interop\SimpleInteropTests.fs" />
Expand Down