-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Disallow curried dependent context function types #9303
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
Conversation
@nicolasstucki If you produce a new bootstrap compiler it would be good to have this PR in it as well. That would allow me to continue with my experiment to use CFTs in the compiler. Right now that's blocked since some methods that would have a CFT result type also have return statements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
.takeWhile(_.isAnonymousFunction) | ||
.toList | ||
.reverse | ||
.map(_.paramSymss.head) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This map can be done before the toList
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that's not necessarily better, or is it? We are talking of iterators of length 1 - 2 on average
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the extra allocation should be fine.
This change will be available in the compiler once #9311 is merged. |
We can't implement them yet. Better to disallow them outright than to try map them
to something wrong and have obscure follow-on errors.
Also: Implement returns in methods with context function result types
Previously, a return in a method with a CFT result type crashed the typer.