Skip to content

Commit a32a0ad

Browse files
committed
Remove references spliced types
1 parent d9df0a2 commit a32a0ad

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,17 @@ class ReifyQuotes extends MacroTransform {
331331
*/
332332
private def makeHole(isTermHole: Boolean, body: Tree, splices: List[Tree], tpe: Type)(implicit ctx: Context): Hole = {
333333
val idx = embedded.addTree(body, NoSymbol)
334-
Hole(isTermHole, idx, splices).withType(tpe).asInstanceOf[Hole]
334+
val holeType = getHoleType(tpe)
335+
Hole(isTermHole, idx, splices).withType(holeType).asInstanceOf[Hole]
336+
}
337+
338+
private def getHoleType(using ctx: Context) = new TypeMap() {
339+
override def apply(tp: Type): Type = tp match {
340+
case tp: TypeRef if tp.typeSymbol.isSplice || tp.typeSymbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot) =>
341+
mapOver(tp.dealias.typeSymbol.info.hiBound)
342+
case tp =>
343+
mapOver(tp)
344+
}
335345
}
336346

337347
override def transform(tree: Tree)(implicit ctx: Context): Tree =

0 commit comments

Comments
 (0)