-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix false negative in DisposedBeforeAsyncRunAnalyzer #77
Conversation
@@ -103,6 +103,9 @@ let collectUses (sourceText : ISourceText) (ast : ParsedInput) (checkFileResults | |||
|| elseExpr |> Option.map hasAsyncOrTaskInBody |> Option.defaultValue false | |||
| SynExpr.TryFinally (tryExpr = tryExpr) -> hasAsyncOrTaskInBody tryExpr | |||
| SynExpr.TryWith (tryExpr = tryExpr) -> hasAsyncOrTaskInBody tryExpr | |||
| SynExpr.Match (clauses = clauses) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make a note that this whole thing isn't tail-recursive? Or that is at least my educated guess.
Should we include SynExpr.MatchBang
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see, that's already covered because to use match!
we would need to be in an async
already like:
let blah = new DisposableThing ()
use blah = blah
async {
match! async {return 1} with
| _ -> async { return "hi" }
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but in theory we could have something like:
let meh = async {
let blah = new DisposableThing ()
use blah = blah
return! async {
match! async {return 1} with
| _ -> async { return "hi" }
}
}
Might not be relevant for now.
Co-authored-by: Florian Verdonck <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
fixes #75