Closed
Description
Compiler version
3.0.0-RC2
Minimized code
// reflection.scala (scala-reflect shim), compiled with Scala 2.13.5
package reflectshims
abstract class Universe {
type Tree >: Null <: AnyRef with TreeApi
trait TreeApi extends Product { this: Tree => }
}
trait Context {
type Tree = universe.Tree
val universe: Universe
}
// Scala2Macros.scala
package example
object Scala2Macro {
def fooImpl(c: reflectshims.Context)(code: c.Tree): c.Tree = code
}
class Scala2Bundle(val c: reflectshims.Context) {
def fooImpl(code: c.Tree): c.Tree = code
}
// MacroDefs.scala, compile with 3.0.0-RC2
package example
object MacroDefs {
// here we simulate code generated for Scala 2 macro implementations
def foo(code: String): String = Scala2Macro.fooImpl(??? : reflectshims.Context)(???).asInstanceOf[String]
def foo2(code: String): String = {
val bundle = new Scala2Bundle(null)
bundle.fooImpl(???).asInstanceOf[String]
}
}
Output
- compile
Scala2Macros.scala
with2.13.5
- compile
MacroDefs.scala
- the signature in TASTy for calling
Scala2Macro.fooImpl
is
fooImpl[Signed Signature(List(reflectshims.Context, reflectshims.Universe.TreeApi),reflectshims.Universe.TreeApi) @fooImpl]
- compile
Scala2Macros.scala
with3.0.0-RC2
- compile
MacroDefs.scala
- the signature in TASTy for calling
Scala2Macro.fooImpl
is
fooImpl[Signed Signature(List(reflectshims.Context, java.lang.Object),java.lang.Object) @fooImpl]
Expectation
I expect the signature to be the same