Skip to content

Type annotations make the pretty-printed tree quadratically large #4678

@nicolasstucki

Description

@nicolasstucki
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions