File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -864,8 +864,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
864864 * that is not a member of an underlying class or trait?
865865 */
866866 def isStructuralTermSelectOrApply (tree : Tree )(using Context ): Boolean = {
867- def isStructuralTermSelect (tree : Select ) = {
868- def hasRefinement (qualtpe : Type ): Boolean = qualtpe.dealias match {
867+ def isStructuralTermSelect (tree : Select ) =
868+ def hasRefinement (qualtpe : Type ): Boolean = qualtpe.dealias match
869869 case RefinedType (parent, rname, rinfo) =>
870870 rname == tree.name || hasRefinement(parent)
871871 case tp : TypeProxy =>
@@ -876,11 +876,12 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
876876 hasRefinement(tp.tp1) || hasRefinement(tp.tp2)
877877 case _ =>
878878 false
879- }
880879 ! tree.symbol.exists
881- && ! tree.qualifier.tpe.widen.derivesFrom(defn.PolyFunctionClass )
882- && tree.isTerm && hasRefinement(tree.qualifier.tpe)
883- }
880+ && tree.isTerm
881+ && {
882+ val qualType = tree.qualifier.tpe
883+ hasRefinement(qualType) && ! qualType.derivesFrom(defn.PolyFunctionClass )
884+ }
884885 def loop (tree : Tree ): Boolean = tree match
885886 case TypeApply (fun, _) =>
886887 loop(fun)
You can’t perform that action at this time.
0 commit comments