Skip to content

Support bounded import selector in tasty reflect #10359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bishabosha opened this issue Nov 17, 2020 · 0 comments · Fixed by #10469
Closed

Support bounded import selector in tasty reflect #10359

bishabosha opened this issue Nov 17, 2020 · 0 comments · Fixed by #10469

Comments

@bishabosha
Copy link
Member

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

@bishabosha bishabosha added this to the 3.0.0-RC1 milestone Nov 23, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 24, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 24, 2020
@nicolasstucki nicolasstucki linked a pull request Nov 24, 2020 that will close this issue
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 24, 2020
nicolasstucki added a commit that referenced this issue Nov 24, 2020
Fix #10359: Add GivenSelector to reflection API
@Kordyjan Kordyjan modified the milestones: 3.0.0-M3, 3.0.0 Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants