Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/staging/HealType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
case prefix: TermRef if tp.symbol.isTypeSplice =>
checkNotWildcardSplice(tp)
if level == 0 then tp else getTagRef(prefix)
case _: NamedType | _: ThisType | NoPrefix =>
case _: TermRef | _: ThisType | NoPrefix =>
if levelInconsistentRootOfPath(tp).exists then
tryHeal(tp)
else
Expand Down
12 changes: 12 additions & 0 deletions tests/pos-macros/i17293.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import scala.quoted.*

trait OuterTrait {
trait X
}

def exampleMacro[T <: OuterTrait: Type](expr: Expr[T])(using Quotes): Expr[OuterTrait#X] = {
'{
val prefix: T = ${ expr }
new prefix.X {}
}
}
12 changes: 12 additions & 0 deletions tests/pos-macros/i17293b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import scala.quoted.*

trait OuterTrait { self =>
trait X

def exampleMacro[T <: self.type: Type](expr: Expr[T])(using Quotes): Expr[self.X] = {
'{
val prefix: T = ${ expr }
new prefix.X {}
}
}
}