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

Fatal error: exception Stack overflow when printing type error message #8856

Open
MekhrubonT opened this issue Aug 5, 2019 · 1 comment

Comments

@MekhrubonT
Copy link
Contributor

commented Aug 5, 2019

I'm having stack overflow exception on trunk with this example:

type t1 = <m : 'b. 'b * ('b * <m:'c. 'c * 'bar> as 'bar)>
type t2 = <m : 'a. 'a * ('a * 'foo)> as 'foo

let f (x : t1) : t2 = x;;

Error message starts with:

File "../equal_errors/sandbox.ml", line 4, characters 22-23:
4 | let f (x : t1) : t2 = x;;
                          ^
Error: This expression has type t1 but an expression was expected of type t2
       The method m has type Fatal error: exception Stack overflow
Raised by primitive operation at file "list.ml", line 234, characters 17-20
Called from file "typing/printtyp.ml", line 1021, characters 43-73
Called from file "list.ml", line 92, characters 20-23
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "typing/printtyp.ml", line 1009, characters 34-55
Called from file "typing/printtyp.ml", line 1082, characters 22-42
Called from file "typing/printtyp.ml", line 1056, characters 27-39
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "typing/printtyp.ml", line 1009, characters 34-55
Called from file "typing/printtyp.ml", line 1082, characters 22-42
Called from file "typing/printtyp.ml", line 1056, characters 27-39
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "typing/printtyp.ml", line 1009, characters 34-55
Called from file "typing/printtyp.ml", line 1082, characters 22-42
Called from file "typing/printtyp.ml", line 1056, characters 27-39
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
Called from file "typing/printtyp.ml", line 1009, characters 34-55
Called from file "typing/printtyp.ml", line 1082, characters 22-42
Called from file "typing/printtyp.ml", line 1056, characters 27-39
Called from file "list.ml", line 92, characters 20-23
Called from file "list.ml", line 92, characters 32-39
Called from file "typing/printtyp.ml", line 945, characters 19-44
@Octachron

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

It looks like I forgot to mark the potential loops when adding the new specialized error message for type mismatches in method with universally quantified types.
I will open a PR with a fix tomorrow.

@Octachron Octachron referenced a pull request that will close this issue Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.