Skip to content

Commit d735476

Browse files
authored
Merge pull request #9316 from dotty-staging/fix-#9310
Fix #9310: Harden avoidMap
2 parents 2229f59 + 4dbca90 commit d735476

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ trait ImplicitRunInfo:
699699

700700
def apply(t: Type) = t.dealias match
701701
case t: TypeRef =>
702-
if isAnchor(t.symbol) then t else applyToUnderlying(t)
702+
if t.symbol.isClass || isAnchor(t.symbol) then t else applyToUnderlying(t)
703703
case t: TypeVar => apply(t.underlying)
704704
case t: ParamRef => applyToUnderlying(t)
705705
case t: ConstantType => apply(t.underlying)

tests/neg/i9310.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//AE-d101cfe6d25117a51897609e673f6c8e74d31e6e
2+
val foo @ this = 0
3+
class Foo {
4+
foo { } // error
5+
}

0 commit comments

Comments
 (0)