class Foo {
val x: Int = (1: @annot1 @annot2 @annot3 @annot4 @annot5)
}
class annot1 extends scala.annotation.Annotation
class annot2 extends scala.annotation.Annotation
class annot3 extends scala.annotation.Annotation
class annot4 extends scala.annotation.Annotation
class annot5 extends scala.annotation.Annotation
types the code as
result of Foo.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
}
...
}
where we should have
val x: Int = 1: Int(1) @annot1 @annot2 @annot3 @annot4 @annot5
The pretty-printed tree is quadratic but is the actual raw tree that way too?
You are right. There is one tree per annotation.
We should still fix the printer
I have a fix for this, any idea where to put the test?
You could add a test to dotty.tools.dotc.printing.PrinterTests
Most helpful comment
We should still fix the printer