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

GADT + subtyping crash #7260

Closed
vicuna opened this issue May 19, 2016 · 2 comments
Closed

GADT + subtyping crash #7260

vicuna opened this issue May 19, 2016 · 2 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented May 19, 2016

Original bug ID: 7260
Reporter: @nojb
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-09-24T15:32:55Z)
Resolution: fixed
Priority: normal
Severity: crash
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: typing
Monitored by: runhang @gasche

Bug description

See the repro below. It crashes with Ctype.Unify(_). Tested with 4.02.3 and 4.03.0.

Replacing

method foo (Dyn ty) =
match ty with
| Int -> (this :> bar)

by

method foo (Dyn Int) =
(this :> bar)

makes the crash go away.

Steps to reproduce

type bar = < bar: unit >

type _ ty = Int : int ty

type dyn = Dyn : 'a ty -> dyn

class foo =
object (this)
method foo (Dyn ty) =
match ty with
| Int -> (this :> bar)
end

@vicuna
Copy link
Author

vicuna commented Jun 2, 2016

Comment author: @garrigue

Fixed in trunk by commit a4e355a.

Was checking level on the wrong node in Subst.type_exp.

@vicuna
Copy link
Author

vicuna commented Jun 2, 2016

Comment author: @nojb

Thanks!

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