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
SI-8447 fix TypeTree printing #3710
Conversation
@@ -715,7 +727,7 @@ trait ClassPrintTests { | |||
|}""", | |||
typedCode = sm""" | |||
|object PM5 { | |||
| scala.collection.immutable.List.apply(1, 2) match { | |||
| scala.collection.immutable.List.apply[Int](1, 2) 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.
Why's this printing an inferred type argument? I was under impression that wasEmpty
handles this.
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.
Yes, it was surprise for me too. Here (wasEmpty || isEmpty) is false
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.
Wow. So what's the original?
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.
Its original is null (I hope so :)). I think wasEmpty is false (I can't check it right now, I'll see a bit later). Since (wasEmpty || isEmpty) is false, TypeTree is not empty, so its tpe is used for printing.
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.
Yes, wasEmpty is false
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.
Crazy :)
Can you please resubmit this against the 2.11.x branch, and finish the review process on the new PR? Thanks! |
Resubmitted pull request |
Added TypeTree printing based on tpe to CodePrinter (if original is not available) - SI-8447