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

Match specialisation broken #6804

Closed
vicuna opened this issue Mar 5, 2015 · 2 comments
Closed

Match specialisation broken #6804

vicuna opened this issue Mar 5, 2015 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Mar 5, 2015

Original bug ID: 6804
Reporter: @chambart
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2016-12-07T10:47:18Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: back end (clambda to assembly)

Bug description

The function Closure.find_action is wrong, an example of failing code:

type t =
| A0 of unit
| A1 of unit
| A2 of unit

let f x = match x with
| A0 () -> 1
| A1 () | A2 () -> 2

let v = f (A1 ())

This was introduced in commit 15812
see c38fc54

@vicuna
Copy link
Author

vicuna commented Mar 5, 2015

Comment author: @alainfrisch

Thanks, fixed by commit 15880 on trunk. Do you know if it is possible for find_action to return None? (i.e. if the matched value can be outside the specified cases)

@vicuna
Copy link
Author

vicuna commented Mar 5, 2015

Comment author: @chambart

No real value could correspond to that, but the usual problem with unreachable code and GADT can occur.

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