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

Comments

Projects
None yet
2 participants
@vicuna
Copy link

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

This comment has been minimized.

Copy link
Author

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.

@vicuna vicuna closed this Dec 7, 2016

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