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

Typechecker overflow the stack on cyclic type annotation after matching on a GADT #6768

Closed
vicuna opened this issue Feb 2, 2015 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Feb 2, 2015

Original bug ID: 6768
Reporter: darktenaibre
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:47:10Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Monitored by: @hcarty

Bug description

The following make the typechecker loop and eventually overflow, while 4.01.0 fails saying the type annotation d is cyclic (which is correct).

Steps to reproduce

type _ prod =
| Prod : ('a * 'y) prod

let f : type t. t prod -> _ =
function Prod -> let module M =
struct
type d = d * d
end in ()

Additional information

Removing the pattern matching, simplifying either the GADT constraint or the type declaration (e.g. "type d = d") or removing the typing constraint/abstraction on f yields the correct error message.

@vicuna
Copy link
Author

vicuna commented Feb 5, 2015

Comment author: @garrigue

Fixed in trunk and 4.02.2 at revisions 15810 and 15811.

The problem was a forgotten wrap_trace_gadt_instance in Typedecl,check_well_founded.

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