Skip to content

Fix #3857: partial fix to generate more shallow tree in LabelDef #3994

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 2 commits into from
Feb 20, 2018

Conversation

liufengyun
Copy link
Contributor

Fix #3857: partial fix to generate more shallow tree in LabelDef

The problem is not with the trees we generated in patmat, but the requirement for nest LabelDef before the calling site.

@@ -76,7 +76,12 @@ class LabelDefs extends MiniPhase {
case t: DefDef =>
assert(t.symbol is Label)
EmptyTree
case _ => if (!labelDefs.isEmpty) super.transform(tree) else tree
case t: If =>
val elsep2 = transform(t.elsep)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining how this generate shallower trees?

@nicolasstucki nicolasstucki merged commit 129685c into scala:master Feb 20, 2018
@Blaisorblade Blaisorblade deleted the fix-3857 branch February 20, 2018 16:32
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.

Stack overflow in LabelDef phase when pattern matching on many nested cases
3 participants