Skip to content

Custom SM-based task builder causes compilation error when used inline #15449

Open
@vzarytovskii

Description

@vzarytovskii

Custom cancellable builder (used in VS layer), see example project below causes

error FS0073: internal error: The local field ResumptionDynamicInfo was referenced but not declared

On simple code (with or without pipe):

open CancellableTasks.CancellableTasks
open System.Threading
open System.Threading.Tasks

let foo () =
    cancellableTask {
        return cancellableTask { () } |> CancellableTask.start CancellationToken.None
    }


[<EntryPoint>]
let main _ = 1

Binding internal cancellableTask resolves it, as does using CancellableTask.singleton:

open CancellableTasks.CancellableTasks
open System.Threading
open System.Threading.Tasks


let foo () =
    cancellableTask { return CancellableTask.singleton () |> CancellableTask.start CancellationToken.None }

let foo1 () =
    cancellableTask {
        let t = cancellableTask { () }
        return t |> CancellableTask.start CancellationToken.None
    }

[<EntryPoint>]
let main _ = 1

All three functions compile just fine.

Full project:
srtp.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-StateMachinesSequence, list, task and other state machine compilationBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions