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

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator Author

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.

@vicuna vicuna closed this Dec 7, 2016

@vicuna vicuna added the back-end label 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
You can’t perform that action at this time.