Closed
Description
Compiler version
3.2.0
Minimized code
import scala.quoted._
import scala.annotation.experimental
trait Foo {}
object Macro {
@experimental
inline def foo() = ${ fooImpl }
@experimental
private def fooImpl(using Quotes) = {
import quotes.reflect._
val name: String = "TestFoo"
val parents = List(TypeTree.of[Object])
val cls = Symbol.newClass(
Symbol.spliceOwner,
name,
parents = parents.map(_.tpe),
_ => Nil,
selfType = None
)
'{
new Foo {}
}
}
}
Output
Report error
method fooImpl is marked @experimental and therefore may only be used in an experimental scope.
Expectation
private def fooImpl(using Quotes) = ...
Without private
modifier, this example compiles (even without @experimental
at call site.).
Should be same with private
modifier.