Skip to content

backgroundTask CE fails to compile #13070

Closed

Description

@cmeeren

This looks fine in the editor (Rider) but fails when compiling:

open System.Threading.Tasks

let map (f: 'a -> 'b) (t: Task<'a>) : Task<'b> =
  backgroundTask {
    let! x = t
    return f x
  }

The errors are:

0>ConsoleApp1\Program.fs(4,3): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\unknown(1,1): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\Program.fs(4,3): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\unknown(1,1): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\Program.fs(4,3): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\Program.fs(4,3): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\unknown(1,1): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\Program.fs(4,3): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\unknown(1,1): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\unknown(1,1): Error FS0073 : internal error: Undefined or unsolved type variable: 'a
0>ConsoleApp1\Program.fs(4,3): Error FS0073 : internal error: Undefined or unsolved type variable: 'a

If I use task instead of backgroundTask, it works fine.

Activity

  1. added
    Area-Compiler-Checking
    on Apr 29, 2022
  2. vzarytovskii commented on Apr 29, 2022

    @vzarytovskii
    Member

    Looks like a duplicate of #12761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingBug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions