From b02c80c2c240b58e8030d2ccf7dc7d7a36b3afe9 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 15 Nov 2015 19:17:40 +0100 Subject: Fix #938 - escaping reference. Need to avoid also symbols in ThisTypes --- src/dotty/tools/dotc/typer/TypeAssigner.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/TypeAssigner.scala') diff --git a/src/dotty/tools/dotc/typer/TypeAssigner.scala b/src/dotty/tools/dotc/typer/TypeAssigner.scala index af5fdd428..f7cda1ef6 100644 --- a/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -46,10 +46,9 @@ trait TypeAssigner { // TODO: measure the cost of using `existsPart`, and if necessary replace it // by a `TypeAccumulator` where we have set `stopAtStatic = true`. tp existsPart { - case tp: NamedType => - forbidden contains tp.symbol - case _ => - false + case tp: NamedType => forbidden contains tp.symbol + case tp: ThisType => forbidden contains tp.cls + case _ => false } def apply(tp: Type): Type = tp match { case tp: TermRef if toAvoid(tp) && variance > 0 => -- cgit v1.2.3