fsprojects / FSharpLint

Lint tool for F#
https://fsprojects.github.io/FSharpLint/
MIT License
302 stars 73 forks source link

Reraise firing too agressively #602

Open Thorium opened 11 months ago

Thorium commented 11 months ago

The feature #509 incorrectly picks raise-exceptions outside try-block, so if you do this:

let ex : Exception = gotMyExceptionFromSomewhere()
raise ex

Then FSharpLint says you should reraise instead, but if you do, the compiler gives error:

error FS0413: Calls to 'reraise' may only occur directly in a handler of a try-with 
Mersho commented 9 months ago

Hey Thorium, thanks for reporting this issue.

I started to look into fixing it, however, I couldn't reproduce what you found (see this commit where I've added a test with your code snippet, and check that CI status is still green: https://github.com/Mersho/FSharpLint/commit/84ae1601530a915f00a85fadafa7669f791c9b4c ).

It would be great if you provide us with more details or even a failure test.