Skip to content

Fix/returns #302

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

Merged
merged 4 commits into from
Dec 17, 2014
Merged

Fix/returns #302

merged 4 commits into from
Dec 17, 2014

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 17, 2014

Several fixes to returns, and one to error reporting. Review by @DarkDimius. Supersedes #297.

Return proto type was wrong; it was the type of the method
(with PolyParams if that type is polymorphic), where it should
have been the return type instantiated with the local type parameters.
We now instantiate the prototype as required.

Note the typing of return nodes is a bit more subtle than in scalac, because
dotc trees are immutable, so the tree pointed at by the context is of no help -
it does not have a return type which we could make use of.
Explanation given in the comment.
If this commit is made without the previous fixes to returns,
we get errors in dotc_parsing (without the fix to polymorphic
returns) and in dotc_core (without the fix in tree transform).
isSuppressed forces computation of the error message; should be
called only when emitting the error.

TODO: Generalize so that other emitting reporters inherit the behavior.
DarkDimius added a commit that referenced this pull request Dec 17, 2014
@DarkDimius DarkDimius merged commit 7f6d234 into scala:master Dec 17, 2014
@allanrenucci allanrenucci deleted the fix/returns branch December 14, 2017 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants