We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
class Bar {val glass : Int = 0} class Foo(val bar : Bar) val f = new Foo(new Bar) { export bar._ } val fGlass = f.glass //error: value glass is not a member of Foo
This code should compile. I see no reason why export shouldn't work in anonymous classes.
The text was updated successfully, but these errors were encountered:
This has nothing to do with exports. If you replace the export with val glass = bar.glass, it fails as well. See https://contributors.scala-lang.org/t/better-type-inference-for-scala-send-us-your-problematic-cases/2410/73 for background.
val glass = bar.glass
I believe we should implement the Structural idea that @smarter proposed in that thread, though.
Structural
Sorry, something went wrong.
Fixed in #9201
class Bar {val glass : Int = 0} class Foo(val bar : Bar) extends scala.reflect.Selectable val f = new Foo(new Bar) { export bar._ } val fGlass = f.glass
https://scastie.scala-lang.org/IrMU1eYaSBOW33nPbo2JOQ
Fix scala#7920: add test
b128faf
Merge pull request #9537 from dotty-staging/fix-7920
c4a14a3
Fix #7920: add test
smarter
Successfully merging a pull request may close this issue.
minimized code
expectation
This code should compile. I see no reason why export shouldn't work in anonymous classes.
The text was updated successfully, but these errors were encountered: