Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expansion of dispose-before-async-is-run #75

Closed
Smaug123 opened this issue Feb 14, 2024 · 0 comments · Fixed by #77
Closed

Expansion of dispose-before-async-is-run #75

Smaug123 opened this issue Feb 14, 2024 · 0 comments · Fixed by #77

Comments

@Smaug123
Copy link
Contributor

I've just raised #74 which contains a failing test case reproducing a situation I encountered at work which the analysers currently do not catch:

module Program =
    let doIt () =
        let blah, anInt = DisposableThing.make ()
        use blah = blah
        match anInt with
        | 3 -> failwith "it wasn't 5"
        | _ ->
            async {
                return "hi"
            }

I guess this might be harder to analyse, and it's not immediately clear to me what the correct algorithm is here (maybe "use statement appears anywhere at top level of function, not in an async block" is actually the right heuristic?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant