-
Notifications
You must be signed in to change notification settings - Fork 1
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
Recursive types cause endless loop #40
Comments
In fact, this issue needs to be solved before |
Simpler even, the new named types should be added to the context, and there should be a "context reference type" that points to an entry in the context instead of getting that value. Whenever an already known type is encountered, this reference should be returned by |
@turion thanks for creating issues and pull requests! I will look into them over weekend. |
Glad to hear from you :) I'm trying to solve this issue here, but I'm not so sure yet whether I can. |
Discovered by @evnu.
The first example is a minimal example that should type check, but hangs. The second one is an actually useful thing people might do in practice.
Like in #39 , the problem is in the treatment of local types. They are evaluated directly, causing an endless loop of variable lookup. Maybe it's possible to stop this by making references to local types lazy. Instead of evaluating them, insert a closure, and only compute it when you need to compare the type spec to something else.
The text was updated successfully, but these errors were encountered: