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 @@ -76,7 +76,7 @@ class HealType(pos: SrcPos)(using Context) extends TypeMap {
tp match
case tp @ NamedType(NoPrefix, _) if level > levelOf(tp.symbol) => tp.symbol
case tp: NamedType if !tp.symbol.isStatic => levelInconsistentRootOfPath(tp.prefix)
case tp: ThisType if level > levelOf(tp.cls) => tp.cls
case tp: ThisType if level > levelOf(tp.cls) && !tp.cls.isRefinementClass => tp.cls
case _ => NoSymbol

/** Try to heal reference to type `T` used in a higher level than its definition.
Expand Down
14 changes: 14 additions & 0 deletions tests/pos/i22648.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import scala.quoted.*

def fooImpl(using Quotes): Expr[Any] =
'{
new AnyRef {
type T = Unit
def make: T = ()
def take(t: T): Unit = ()
}: {
type T
def make: T
def take(t: T): Unit
}
}