@@ -681,7 +681,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
681
681
then
682
682
report.error(StableIdentPattern (tree, pt), tree.srcPos)
683
683
684
- def typedSelect (tree0 : untpd.Select , pt : Type , qual : Tree )(using Context ): Tree =
684
+ def typedSelectWithAdapt (tree0 : untpd.Select , pt : Type , qual : Tree )(using Context ): Tree =
685
685
val selName = tree0.name
686
686
val tree = cpy.Select (tree0)(qual, selName)
687
687
val superAccess = qual.isInstanceOf [Super ]
@@ -703,10 +703,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
703
703
// there's a simply visible type variable in the result; try again with a more defined qualifier type
704
704
// There's a second trial where we try to instantiate all type variables in `qual.tpe.widen`,
705
705
// but that is done only after we search for extension methods or conversions.
706
- typedSelect (tree, pt, qual)
706
+ typedSelectWithAdapt (tree, pt, qual)
707
707
else if qual.tpe.isSmallGenericTuple then
708
708
val elems = qual.tpe.widenTermRefExpr.tupleElementTypes.getOrElse(Nil )
709
- typedSelect (tree, pt, qual.cast(defn.tupleType(elems)))
709
+ typedSelectWithAdapt (tree, pt, qual.cast(defn.tupleType(elems)))
710
710
else
711
711
val tree1 = tryExtensionOrConversion(
712
712
tree, pt, IgnoredProto (pt), qual, ctx.typerState.ownedVars, this , inSelect = true )
@@ -728,15 +728,15 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
728
728
finish(tree1, qual1, checkedType1)
729
729
else if qual1.tpe.isSmallGenericTuple then
730
730
gadts.println(i " Tuple member selection healed by GADT approximation " )
731
- typedSelect (tree, pt, qual1)
731
+ typedSelectWithAdapt (tree, pt, qual1)
732
732
else
733
733
tryExtensionOrConversion(tree1, pt, IgnoredProto (pt), qual1, ctx.typerState.ownedVars, this , inSelect = true )
734
734
else EmptyTree
735
735
}
736
736
if ! tree1.isEmpty then
737
737
tree1
738
738
else if canDefineFurther(qual.tpe.widen) then
739
- typedSelect (tree, pt, qual)
739
+ typedSelectWithAdapt (tree, pt, qual)
740
740
else if qual.tpe.derivesFrom(defn.DynamicClass )
741
741
&& selName.isTermName && ! isDynamicExpansion(tree)
742
742
then
@@ -752,14 +752,14 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
752
752
inaccessibleErrorType(rawType, superAccess, tree.srcPos)
753
753
case _ =>
754
754
notAMemberErrorType(tree, qual, pt))
755
- end typedSelect
755
+ end typedSelectWithAdapt
756
756
757
757
def typedSelect (tree : untpd.Select , pt : Type )(using Context ): Tree = {
758
758
record(" typedSelect" )
759
759
760
760
def typeSelectOnTerm (using Context ): Tree =
761
761
val qual = typedExpr(tree.qualifier, shallowSelectionProto(tree.name, pt, this , tree.nameSpan))
762
- typedSelect (tree, pt, qual).withSpan(tree.span).computeNullable()
762
+ typedSelectWithAdapt (tree, pt, qual).withSpan(tree.span).computeNullable()
763
763
764
764
def javaSelectOnType (qual : Tree )(using Context ) =
765
765
// semantic name conversion for `O$` in java code
@@ -3563,7 +3563,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3563
3563
if isExtension then return found
3564
3564
else
3565
3565
checkImplicitConversionUseOK(found, selProto)
3566
- return withoutMode(Mode .ImplicitsEnabled )(typedSelect (tree, pt, found))
3566
+ return withoutMode(Mode .ImplicitsEnabled )(typedSelectWithAdapt (tree, pt, found))
3567
3567
case failure : SearchFailure =>
3568
3568
if failure.isAmbiguous then
3569
3569
return
0 commit comments