Skip to content

Commit 2bbf9ca

Browse files
committed
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.
1 parent 8464c16 commit 2bbf9ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
637637
case tree: Select =>
638638
def hasRefinement(qualtpe: Type): Boolean = qualtpe.dealias match {
639639
case RefinedType(parent, rname, rinfo) =>
640-
rname == tree.name && tree.tpe.widen <:< rinfo || hasRefinement(parent)
640+
rname == tree.name || hasRefinement(parent)
641641
case tp: TypeProxy =>
642642
hasRefinement(tp.underlying)
643643
case tp: OrType =>

0 commit comments

Comments
 (0)