Skip to content

Disposable will be disposed before async is run #54

@nojaf

Description

@nojaf

Original request by @Smaug123:

let foo () =
    use blah = thing
    async {
        return "hi"
    }

We should warn that use blah will be disposed of before the async is run. This should happen when a function returns an Async/Task.

An additional request is that this check can be disabled by a code comment.
Something like:

let foo () =
    // Note: disposed before returned async is run
    use blah = thing
    async {
        return "hi"
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions