From 2bbf9ca068dd550ac68a83f33f7fc94505e6cfcc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 28 Jan 2017 16:24:06 +1100 Subject: Generalize test whether access is to a refinement A previous type comparison was wrong because it did not map refined-this types. I believe it was also redundant, so the easiest fix is to drop it. --- compiler/src/dotty/tools/dotc/ast/TreeInfo.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/src') diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index 429b7235b..bcda4b92f 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -637,7 +637,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => case tree: Select => def hasRefinement(qualtpe: Type): Boolean = qualtpe.dealias match { case RefinedType(parent, rname, rinfo) => - rname == tree.name && tree.tpe.widen <:< rinfo || hasRefinement(parent) + rname == tree.name || hasRefinement(parent) case tp: TypeProxy => hasRefinement(tp.underlying) case tp: OrType => -- cgit v1.2.3