Skip to content

Fix #9168: Use () for finally with empty expression #9169

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 1 commit into from
Jun 12, 2020

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki self-assigned this Jun 12, 2020
@nicolasstucki nicolasstucki linked an issue Jun 12, 2020 that may be closed by this pull request
@nicolasstucki nicolasstucki removed their assignment Jun 12, 2020
@nicolasstucki nicolasstucki requested a review from smarter June 12, 2020 10:03
if (in.token == FINALLY) {
in.nextToken();
val expr = subExpr()
if expr.span.exists then expr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking the span, can't we check if the tree is empty/null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both for finally ; and finally null the expr is Literal(Constant(null)) but only the latter has a span.

@nicolasstucki nicolasstucki marked this pull request as ready for review June 12, 2020 12:49
@nicolasstucki nicolasstucki merged commit 917599f into scala:master Jun 12, 2020
@nicolasstucki nicolasstucki deleted the fix-#9168 branch June 12, 2020 12:53
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.

Awesome explanation receives a null tree
2 participants