Skip to content

Commit 2f3c310

Browse files
committed
Fix invariant quote type holes
1 parent 064c213 commit 2f3c310

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,8 +3056,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
30563056
// that we have found, seal them in a quoted.Type and add them to the result
30573057
def typeHoleApproximation(sym: Symbol) =
30583058
val fromAboveAnnot = sym.hasAnnotation(dotc.core.Symbols.defn.QuotedRuntimePatterns_fromAboveAnnot)
3059-
val approx = ctx1.gadt.approximation(sym, !fromAboveAnnot)
3060-
reflect.TypeReprMethods.asType(approx)
3059+
val fullBounds = ctx1.gadt.fullBounds(sym)
3060+
val tp = if fromAboveAnnot then fullBounds.hi else fullBounds.lo
3061+
reflect.TypeReprMethods.asType(tp)
30613062
matchings.map { tup =>
30623063
Tuple.fromIArray(typeHoles.map(typeHoleApproximation).toArray.asInstanceOf[IArray[Object]]) ++ tup
30633064
}

0 commit comments

Comments
 (0)