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

Typing crash when pattern matching with polymorphic variants + exception cases #7083

Closed
vicuna opened this issue Dec 10, 2015 · 4 comments

Comments

@vicuna
Copy link

commented Dec 10, 2015

Original bug ID: 7083
Reporter: @nojb
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-02-16T14:18:12Z)
Resolution: fixed
Priority: normal
Severity: crash
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @gasche @hcarty @alainfrisch

Bug description

The code

let f x =
match x with
| `A -> ()
| exception Not_found -> ()

crashes the typechecker.

The problem seems to have been introduced by #305. The crash occurs when calling Parmatch.pressure_variants to check for exhaustiveness. This function calls Parmatch.filter_all which calls Parmatch.normalize_pat which crashes upon seeing the exception case.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 10, 2015

Comment author: @trefis

Well spotted, I'll submit a fix tomorrow.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 10, 2015

Comment author: @gasche

... and a regression test!

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 11, 2015

Comment author: @alainfrisch

#343

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 12, 2015

Comment author: @gasche

The problem raised by nojebar highlighted that we did not understand the implications of #305 as well as we thought. After some discussion with Thomas Refis and Luc Maranget, I decided to revert the change from trunk -- it is not ready for 4.03 and will have to wait for a later release.

So, many thanks for the diligent reporting!

@vicuna vicuna closed this Feb 16, 2017

@vicuna vicuna added the typing label Mar 14, 2019

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.