FSharpLint icon indicating copy to clipboard operation
FSharpLint copied to clipboard

Reraise firing too agressively

Open Thorium opened this issue 1 year ago • 1 comments

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 

Thorium avatar Oct 09 '23 15:10 Thorium

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.

Mersho avatar Nov 29 '23 13:11 Mersho