-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:inlinearea:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesarea:typeritype:bug
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
yilinwei, pweisenburger and xerial
Metadata
Metadata
Assignees
Labels
area:inlinearea:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesarea:typeritype:bug