Skip to content

make refined type printing more source compatible #12939

Closed
@bishabosha

Description

@bishabosha

Compiler version

3.0.1-RC1

Minimized example

class Bag extends reflect.Selectable

val m = new Bag { val f = 23; def g = 47; def h(i: Int): Int = i }

Output

in the repl the type printed has a type that is not source compatible

scala> val m = new Bag { val f = 23; def g = 47; def h(i: Int): Int = i; var i = 101; type N = Int }
val m: Bag{f: Int; g: => Int; h(i: Int): Int; i: Int; i_=(x$1: Int): Unit; N = Int} = anon$1@403364e9

Expectation

we annotate each refinement with if it is a type, def or val

scala> val m = new Bag { val f = 23; def g = 47; def h(i: Int): Int = i; var i = 101; type N = Int }
val m: Bag{val f: Int; def g: Int; def h(i: Int): Int; def i: Int; def i_=(x$1: Int): Unit; type N = Int} = anon$1@403364e9

Metadata

Metadata

Assignees

No one assigned

    Labels

    SpreeSuitable for a future Spreearea:reportingError reporting including formatting, implicit suggestions, etcexp:novicegood first issuePerfect for someone who wants to get started contributingitype:enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions