-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Infinite recursion when printing cyclic types #91
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
Comments
@samuelgruetter It looks like a type is printed with toString, where it should be printed with show. Unlike toString, show contains a cycle detection. Can you look into it, and diagnose or fix please? |
That was indeed the case: TermRef was printed with I added some code which makes dotty crash not only in Scala 2 solves this problem with the method I noticed that dotty also has several cycle detection mechanisms, two of which I thought (at first sight) might be suitable for this issue:
So I think the existing cycle detection mechanisms in dotty are not sufficient and we need to introduce an additional mechanism, similar to @odersky do you agree? |
1) Verify we survive illegal infinite paths. Closes scala#91. 2) Verify we handle fbounds in and types correctly.
I verified that this works now. |
1) Verify we survive illegal infinite paths. Closes scala#91. 2) Verify we handle fbounds in and types correctly.
In this example
we run into an infinite recursion:
Note that scalac correctly rejects this example:
I suspect that there might not only be a problem with printing, but also with cycle detection...
The text was updated successfully, but these errors were encountered: