Skip to content

Curried type member functions pretty-print incorrectly #6475

@Blaisorblade

Description

@Blaisorblade

Gave a look at #6474; this doesn't look too good. Type members of Foo2 and Foo3 are printed incorrectly.

$ dotr -Xprint:frontend
Starting dotty REPL...
scala> object Foo1 { type T[+A] = (A, Int) }
     | object Foo2 { type T[+A] = [+B] => (A, B) }
     | object Foo3 { type T[+A] = [+B] => [C] => (A, B) }
     |
result of rs$line$1 after frontend:
package <empty> {
  final lazy module val rs$line$1: rs$line$1$ = new rs$line$1$()
  final module class rs$line$1$() extends Object(), _root_.scala.Serializable {
    this: rs$line$1.type =>

    final lazy module val Foo1: Foo1$ = new Foo1$()
    final module class Foo1$() extends Object(), _root_.scala.Serializable {
      this: Foo1.type =>

      type T[+A >: Nothing <: Any] = Tuple2[A, Int]
    }
    final lazy module val Foo2: Foo2$ = new Foo2$()
    final module class Foo2$() extends Object(), _root_.scala.Serializable {
      this: Foo2.type =>

      type T[+B >: Nothing <: Any] = Tuple2[A, B]
    }
    final lazy module val Foo3: Foo3$ = new Foo3$()
    final module class Foo3$() extends Object(), _root_.scala.Serializable {
      this: Foo3.type =>

      type T[C >: Nothing <: Any] = Tuple2[A, B]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions