Skip to content

Support bounded import selector in tasty reflect #10359

Closed
@bishabosha

Description

@bishabosha

Minimized code

after compiling the following code:

// Test.tasty
object Test {
  class Givens {
    given Int = 23
    given String = "the string"
  }
  class Foo {
    val g: Givens = Givens()
    import g.{given Int}
  }
}

use scalac -decompile Test.tasty

Output

@scala.annotation.internal.SourceFile("sandbox/exports/example.scala") object Test {
  class Givens() {
    final def given_Int: scala.Int = 23
    final def given_String: scala.Predef.String = "the string"
  }
  class Foo() {
    val g: Test.Givens = new Test.Givens()
    import Foo.this.g.{}
  }
}

Expectation

@scala.annotation.internal.SourceFile("sandbox/exports/example.scala") object Test {
  class Givens() {
    final def given_Int: scala.Int = 23
    final def given_String: scala.Predef.String = "the string"
  }
  class Foo() {
    val g: Test.Givens = new Test.Givens()
    import Foo.this.g.{given Int}
  }
}

and also a ways to reflect on this in tasty reflect

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions