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

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 2, 2016

Comment author: @nojb

Thanks!

@vicuna vicuna closed this Sep 24, 2017

@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.