Open nicolasstucki opened 3 years ago
It seems we fall back to the class a location for inline accessors when they should be in a package. https://github.com/lampepfl/dotty/blob/master/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala#L137
We could create an object Inline$Accessors
in that package to place them.
That looks like a pretty tall order. I don't think I have the time to do that. Somebody else will have to pick that up.
Is this fixable without causing existing code to break its ABI on recompilation? If not I don't think this can be done in Scala 3.
Or I guess we could keep the existing accessors to preserve the ABI and just add new ones?
We could do that. It's still a tall order. Inline accessors are a complex piece of code. How urgent is this? Is this a feature request or a real bug? Alternatively, we could also require that the body of quotes can only access public members. I think I would prefer that. It seems weird to expose something that is private as data.
Test case (should compile)
import scala.quoted.*
package foo {
trait Bar:
def bar(using Quotes) = '{ Baz }
private[foo] object Baz
}
Compiler version
3.0.1
Minimized code
Output
After typer we generate the following inline accessor for a module
There are several issues with this scheme
Expectation