diff --git a/compiler/src/scala/quoted/runtime/impl/QuoteContextImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuoteContextImpl.scala index 5c7732c49aca..91361b94ab59 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuoteContextImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuoteContextImpl.scala @@ -1298,6 +1298,10 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu end TypeBoundsTreeTypeTest object TypeBoundsTree extends TypeBoundsTreeModule: + def apply(low: TypeTree, hi: TypeTree): TypeBoundsTree = + withDefaultPos(tpd.TypeBoundsTree(low, hi)) + def copy(original: Tree)(low: TypeTree, hi: TypeTree): TypeBoundsTree = + tpd.cpy.TypeBoundsTree(original)(low, hi, tpd.EmptyTree) def unapply(x: TypeBoundsTree): Option[(TypeTree, TypeTree)] = Some((x.low, x.hi)) end TypeBoundsTree @@ -1323,6 +1327,7 @@ class QuoteContextImpl private (using val ctx: Context) extends QuoteContext, Qu end WildcardTypeTreeTypeTest object WildcardTypeTree extends WildcardTypeTreeModule: + def apply(tpe: TypeRepr): WildcardTypeTree = withDefaultPos(tpd.Underscore(tpe)) def unapply(x: WildcardTypeTree): Boolean = true end WildcardTypeTree diff --git a/library/src/scala/quoted/QuoteContext.scala b/library/src/scala/quoted/QuoteContext.scala index e1ca3ada62e4..1846766e0945 100644 --- a/library/src/scala/quoted/QuoteContext.scala +++ b/library/src/scala/quoted/QuoteContext.scala @@ -1561,6 +1561,8 @@ trait QuoteContext { self: runtime.QuoteUnpickler & runtime.QuoteMatching => val TypeBoundsTree: TypeBoundsTreeModule trait TypeBoundsTreeModule { this: TypeBoundsTree.type => + def apply(low: TypeTree, hi: TypeTree): TypeBoundsTree + def copy(original: Tree)(low: TypeTree, hi: TypeTree): TypeBoundsTree def unapply(x: TypeBoundsTree): Option[(TypeTree, TypeTree)] } @@ -1587,6 +1589,7 @@ trait QuoteContext { self: runtime.QuoteUnpickler & runtime.QuoteMatching => val WildcardTypeTree: WildcardTypeTreeModule trait WildcardTypeTreeModule { this: WildcardTypeTree.type => + def apply(tpe: TypeRepr): WildcardTypeTree /** Matches a TypeBoundsTree containing wildcard type bounds */ def unapply(x: WildcardTypeTree): Boolean } @@ -3548,8 +3551,9 @@ trait QuoteContext { self: runtime.QuoteUnpickler & runtime.QuoteMatching => case tree: Statement => transformStatement(tree)(owner) case tree: TypeTree => transformTypeTree(tree)(owner) - case tree: TypeBoundsTree => tree // TODO traverse tree - case tree: WildcardTypeTree => tree // TODO traverse tree + case tree: TypeBoundsTree => + TypeBoundsTree.copy(tree)(transformTypeTree(tree.low)(owner), transformTypeTree(tree.hi)(owner)) + case tree: WildcardTypeTree => tree case tree: CaseDef => transformCaseDef(tree)(owner) case tree: TypeCaseDef =>