Skip to content

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 ?

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.

2 participants