@@ -724,7 +724,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
724724 then
725725 report.error(StableIdentPattern (tree, pt), tree.srcPos)
726726
727- def typedSelect (tree0 : untpd.Select , pt : Type , qual : Tree )(using Context ): Tree =
727+ def typedSelectWithAdapt (tree0 : untpd.Select , pt : Type , qual : Tree )(using Context ): Tree =
728728 val selName = tree0.name
729729 val tree = cpy.Select (tree0)(qual, selName)
730730 val superAccess = qual.isInstanceOf [Super ]
@@ -753,7 +753,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
753753 // there's a simply visible type variable in the result; try again with a more defined qualifier type
754754 // There's a second trial where we try to instantiate all type variables in `qual.tpe.widen`,
755755 // but that is done only after we search for extension methods or conversions.
756- return typedSelect (tree, pt, qual)
756+ return typedSelectWithAdapt (tree, pt, qual)
757757
758758 // Otherwise, try to expand a named tuple selection
759759 val namedTupleElems = qual.tpe.widenDealias.namedTupleElementTypes
@@ -769,7 +769,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
769769 // to the Tuple class of the right arity and select from that one
770770 if qual.tpe.isSmallGenericTuple then
771771 val elems = qual.tpe.widenTermRefExpr.tupleElementTypes.getOrElse(Nil )
772- return typedSelect (tree, pt, qual.cast(defn.tupleType(elems)))
772+ return typedSelectWithAdapt (tree, pt, qual.cast(defn.tupleType(elems)))
773773
774774 // Otherwise try an extension or conversion
775775 if selName.isTermName then
@@ -796,7 +796,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
796796
797797 if qual1.tpe.isSmallGenericTuple then
798798 gadts.println(i " Tuple member selection healed by GADT approximation " )
799- return typedSelect (tree, pt, qual1)
799+ return typedSelectWithAdapt (tree, pt, qual1)
800800
801801 val tree2 = tryExtensionOrConversion(tree1, pt, IgnoredProto (pt), qual1, ctx.typerState.ownedVars, this , inSelect = true )
802802 if ! tree2.isEmpty then
@@ -805,7 +805,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
805805 // Otherwise, if there are uninstantiated type variables in the qualifier type,
806806 // instantiate them and try again
807807 if canDefineFurther(qual.tpe.widen) then
808- return typedSelect (tree, pt, qual)
808+ return typedSelectWithAdapt (tree, pt, qual)
809809
810810 def dynamicSelect (pt : Type ) =
811811 val tree2 = cpy.Select (tree0)(untpd.TypedSplice (qual), selName)
@@ -854,7 +854,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
854854 inaccessibleErrorType(rawType, superAccess, tree.srcPos)
855855 case _ =>
856856 notAMemberErrorType(tree, qual, pt))
857- end typedSelect
857+ end typedSelectWithAdapt
858858
859859 /** Expand a selection A.m on a context bound companion A with type
860860 * `<context-bound-companion>[ref_1 | ... | ref_N]` as described by
@@ -906,7 +906,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
906906 case witness : TermRef =>
907907 val altQual = tpd.ref(witness).withSpan(qual.span)
908908 val altCtx = ctx.fresh.setNewTyperState()
909- val alt = typedSelect (tree, pt, altQual)(using altCtx)
909+ val alt = typedSelectWithAdapt (tree, pt, altQual)(using altCtx)
910910 def current = (alt, altCtx.typerState, witness)
911911 if altCtx.reporter.hasErrors then prevs
912912 else
@@ -938,7 +938,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
938938 if ctx.isJava then
939939 javaSelection(qual)
940940 else
941- typedSelect (tree, pt, qual).withSpan(tree.span).computeNullable()
941+ typedSelectWithAdapt (tree, pt, qual).withSpan(tree.span).computeNullable()
942942
943943 def javaSelection (qual : Tree )(using Context ) =
944944 val tree1 = assignType(cpy.Select (tree)(qual, tree.name), qual)
@@ -3879,7 +3879,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
38793879 if isExtension then return found
38803880 else
38813881 checkImplicitConversionUseOK(found, selProto)
3882- return withoutMode(Mode .ImplicitsEnabled )(typedSelect (tree, pt, found))
3882+ return withoutMode(Mode .ImplicitsEnabled )(typedSelectWithAdapt (tree, pt, found))
38833883 case failure : SearchFailure =>
38843884 if failure.isAmbiguous then
38853885 return
0 commit comments