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

Fix #4678: Create single Typed tree with multiple type annotations #5714

Merged
merged 2 commits into from
Jan 16, 2019

Conversation

nicolasstucki
Copy link
Contributor

This is mostly useful for printers as it represents what is written in the source.
I may also slightly improve performance of later phases.

With this change the tree becomes

result of tests/pos/i4678.scala after frontend:
package <empty> {
  class Foo() extends Object() { 
    val x: Int = 1:Int(1) @annot1 @annot2 @annot3 @annot4 @annot5
  }
  ...
}

instead of

result of tests/pos/i4678.scala after frontend:
package <empty> {
  class Foo() extends Object() { 
    val x: Int = 
      1:Int(1) @annot1:Int(1) @annot1 @annot2:Int(1) @annot1 @annot2 @annot3:
        Int(1) @annot1 @annot2 @annot3 @annot4
      :Int(1) @annot1 @annot2 @annot3 @annot4 @annot5
  }
  ...
}

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Can we add a decompilation test to ensure the output is as expected ?

tests/pos/i4678.scala Show resolved Hide resolved
This is mostly useful for printers as it represents what is written in the source.
I may also slightly improve performance of later phases.
@nicolasstucki
Copy link
Contributor Author

Added a decompilation test

@nicolasstucki
Copy link
Contributor Author

I tried the definitions tests and it fails on both versions (before and after these changes). The trees in the annotated type do have the correct positions, nothing is lost with this change. I would fix that in a different PR as it is completely unrelated. Opened #5722 to track this issue.

@smarter smarter merged commit 4ecbb60 into scala:master Jan 16, 2019
@Blaisorblade Blaisorblade deleted the fix-#4678 branch January 16, 2019 12:20
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.

None yet

2 participants