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
Closed
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna 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
Copy link
Author

vicuna commented Dec 10, 2015

Comment author: @trefis

Well spotted, I'll submit a fix tomorrow.

@vicuna
Copy link
Author

vicuna commented Dec 10, 2015

Comment author: @gasche

... and a regression test!

@vicuna
Copy link
Author

vicuna commented Dec 11, 2015

Comment author: @alainfrisch

#343

@vicuna
Copy link
Author

vicuna 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 as completed 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
Development

No branches or pull requests

2 participants