Skip to content

Commit e9a3aca

Browse files
committed
Fix #938 - escaping reference.
Need to avoid also symbols in ThisTypes
1 parent fc42734 commit e9a3aca

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ trait TypeAssigner {
4646
// TODO: measure the cost of using `existsPart`, and if necessary replace it
4747
// by a `TypeAccumulator` where we have set `stopAtStatic = true`.
4848
tp existsPart {
49-
case tp: NamedType =>
50-
forbidden contains tp.symbol
51-
case _ =>
52-
false
49+
case tp: NamedType => forbidden contains tp.symbol
50+
case tp: ThisType => forbidden contains tp.cls
51+
case _ => false
5352
}
5453
def apply(tp: Type): Type = tp match {
5554
case tp: TermRef if toAvoid(tp) && variance > 0 =>

0 commit comments

Comments
 (0)