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

Soundness bug with GADTs and lazy #7421

Closed
vicuna opened this issue Nov 25, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Nov 25, 2016

Original bug ID: 7421
Reporter: @lpw25
Assigned to: @garrigue
Status: resolved (set by @garrigue on 2016-12-10T02:48:23Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.04.0
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: typing
Monitored by: @gasche @yallop

Bug description

The exhaustivity/refutation checks do not taken into account the hidden | member of the lazy type:

type (_, _) eq = Refl : ('a, 'a) eq;;

type (_, _) eq = Refl : ('a, 'a) eq

type empty = (int, unit) eq;;

type empty = (int, unit) eq

let f (x : ('a, empty Lazy.t) result) =

  match x with
  | Ok x -> x
  | Error (lazy _) -> .;;
    val f : ('a, empty Lazy.t) result -> 'a = <fun>

(f (Error (lazy (raise Not_found))) : string list list);;

Segmentation fault

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 10, 2016

Comment author: @garrigue

Fixed by commit 2608a18.
Do not split in a lazy pattern.

@vicuna vicuna closed this Dec 10, 2016

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 10, 2016

Comment author: @gasche

Is this really fixed in 2608a18? It doesn't seem related to lazy patterns
2608a18

(I was curious to have a look at the patch. Would you have forgotten to commit it?)

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 10, 2016

Comment author: @garrigue

Sorry, this was the fix for #7424.

This PR is actually fixed by commit d8429e5.

@vicuna vicuna added the typing 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.