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?)
I've just raised https://github.com/G-Research/fsharp-analyzers/pull/74 which contains a failing test case reproducing a situation I encountered at work which the analysers currently do not catch:
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 anasync
block" is actually the right heuristic?)