Open
Description
Minimized example
import scala.quoted._
def myMacroImpl[T](using tp: Type[T])(using QuoteContext) = {
val x = Expr(tp.show)
'{ new TPrint[T]($x) }
}
class TPrint[T](override val toString: String)
inline def default[T]: TPrint[T] = ${ myMacroImpl[T] }
object Test extends App {
type X = scala.Int with scala.Predef.String{}
val s1: TPrint[X] = default[X]
val s2: TPrint[X] = default
println(s1)
println(s2)
}
Output
Test.X
scala.Int & scala.Predef.String
Expectation
Both should be X