Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

VladimirNik
Copy link
Contributor

Added TypeTree printing based on tpe to CodePrinter (if original is not available) - SI-8447

@VladimirNik
Copy link
Contributor Author

Review by @xeno-by @densh

@@ -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 {
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, wasEmpty is false

Copy link
Member

Choose a reason for hiding this comment

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

Crazy :)

@VladimirNik VladimirNik added tested and removed tested labels May 6, 2014
@retronym
Copy link
Member

retronym commented May 9, 2014

Can you please resubmit this against the 2.11.x branch, and finish the review process on the new PR? Thanks!

@VladimirNik
Copy link
Contributor Author

Resubmitted pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants