Skip to content

Fix returns inside while cycles. #297

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

Closed
wants to merge 3 commits into from

Conversation

DarkDimius
Copy link
Contributor

Fix returns inside while cycles.
typing of Returns looked for directly enclosing method, but didn't take in
account presence of synthesised labels. So if one had a return inside a
while loop it would be adapted to type of while, which is always unit. The
adaption always succeeds and it was left unnoticed.

review by @odersky please

typing of Returns looked for directly enclosing method,
but didn't take in account presence of synthesised labels.
So if one had a return inside a while loop it would be
adapted to type of while, which is always unit.
The adaption always succeeds and it was left unnoticed.
@DarkDimius DarkDimius changed the title F Fix returns inside while cycles. Dec 16, 2014
@DarkDimius
Copy link
Contributor Author

For some reason after this change dotc_parsing fails with error

[info] Test dotc.tests.dotc_parsing started
./src/dotty/tools/dotc/parsing/MarkupParserCommon.scala:236: error: type mismatch:
 found   : T
 required: T
        return handler(positioner(), sb.toString)

and continues to typecheck with error types for 60 seconds. On travis that is at least 10 times slower this kills the build.

@odersky odersky mentioned this pull request Dec 17, 2014
@odersky odersky closed this Dec 17, 2014
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