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] =>
864
864
* that is not a member of an underlying class or trait?
865
865
*/
866
866
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
869
869
case RefinedType (parent, rname, rinfo) =>
870
870
rname == tree.name || hasRefinement(parent)
871
871
case tp : TypeProxy =>
@@ -876,11 +876,12 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
876
876
hasRefinement(tp.tp1) || hasRefinement(tp.tp2)
877
877
case _ =>
878
878
false
879
- }
880
879
! 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
+ }
884
885
def loop (tree : Tree ): Boolean = tree match
885
886
case TypeApply (fun, _) =>
886
887
loop(fun)
You can’t perform that action at this time.
0 commit comments