-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix(compiler): Correct type approximation on recursive functions #2154
Conversation
@spotandjake I looked into this and I don't love the solution here. Yes, default values are Do you want to update that in this PR or close it and have me make the changes? |
@spotandjake and I chatted offline and decided that it's better to just handle it this way rather than handle this case in each of the other places it comes up. |
I just added an additional test that tests for the invalid case in the original issue where the labels are missing. |
This pr fixes #2151, we seem to have made an invalid assumption when creating the type here which was causing the crashes.
For anyone interested the root cause of the issue was in
type_approx
which is used when we are guessing types for recursive functions, we were producing the aTTyvar
instead of anoption(TTyvar)
on default arguments.