Skip to content

Unexpected tree could not be interpreted #5097

Closed
@allanrenucci

Description

@allanrenucci
// 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions