-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #8843: Normalize type when constant folding #8852
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
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.
LGTM
Maybe also add the test case from #8842
@@ -510,7 +510,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => | |||
*/ | |||
def constToLiteral(tree: Tree)(implicit ctx: Context): Tree = { | |||
val tree1 = ConstFold(tree) | |||
tree1.tpe.widenTermRefExpr.dealias match { | |||
tree1.tpe.widenTermRefExpr.dealias.normalized match { |
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.
tree1.tpe.widenTermRefExpr.dealias.normalized match { | |
tree1.tpe.widenTermRefExpr.normalized match { |
I'm wondering if it will make a difference.
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.
It does not work without the dealiasing
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.
Maybe we should refine normalized
.
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.
@OlivierBlanvillain should normalized
dealias?
This did not fix #8842 |
Also fixes #8854