Closed
Description
// Foo.scala
import scala.quoted._
class Foo {
rewrite def foo1: String = ~Foo.impl
}
object Foo {
rewrite def foo2: String = ~Foo.impl
private def impl: Expr[String] = '("")
}
// Test.scala
class Test {
def test1: String = (new Foo).foo1 // error
def test2: String = Foo.foo2 // ok
}
> dotc -d out Foo.scala
> dotc -classpath out Test.scala
-- Error: Test.scala:2:22 ---------------------------------
2 | def test1: String = (new Foo).foo1
| ^
| Unexpected tree could not be interpreted: Select(Ident(Foo_this),inline$impl)
If def impl
is not private, the code compiles