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

Exceptions raised by type checker #5907

Closed
vicuna opened this issue Jan 25, 2013 · 1 comment
Closed

Exceptions raised by type checker #5907

vicuna opened this issue Jan 25, 2013 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Jan 25, 2013

Original bug ID: 5907
Reporter: pzimmer
Assigned to: @garrigue
Status: closed (set by @garrigue on 2013-01-26T01:48:02Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 4.00.1
Fixed in version: 4.00.2+dev
Category: typing
Monitored by: @gasche pzimmer

Bug description

Unification involving a type declared as "type 'a t = 'a" generate exceptions instead of legitimate type errors:

    OCaml version 4.00.1

type 'a t = 'a;;

type 'a t = 'a

let f (g : 'a list -> 'a t -> 'a) s = g s s;;

Fatal error: exception Ctype.Unify(_)

let f (g : 'a * 'b -> 'a t -> 'a) s = g s s;;

Fatal error: exception Stack_overflow

@vicuna
Copy link
Author

vicuna commented Jan 26, 2013

Comment author: @garrigue

Fixed in trunk and 4.00, at revisions 13280 and 13281.

The call to the occur check in Ctype.unify3 was wrong.
Hard to believe this was not detected earlier...
Thank you very much for strengthening our so weak test suite.

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