@@ -724,7 +724,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
724
724
then
725
725
report.error(StableIdentPattern (tree, pt), tree.srcPos)
726
726
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 =
728
728
val selName = tree0.name
729
729
val tree = cpy.Select (tree0)(qual, selName)
730
730
val superAccess = qual.isInstanceOf [Super ]
@@ -753,7 +753,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
753
753
// there's a simply visible type variable in the result; try again with a more defined qualifier type
754
754
// There's a second trial where we try to instantiate all type variables in `qual.tpe.widen`,
755
755
// 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)
757
757
758
758
// Otherwise, try to expand a named tuple selection
759
759
val namedTupleElems = qual.tpe.widenDealias.namedTupleElementTypes
@@ -769,7 +769,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
769
769
// to the Tuple class of the right arity and select from that one
770
770
if qual.tpe.isSmallGenericTuple then
771
771
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)))
773
773
774
774
// Otherwise try an extension or conversion
775
775
if selName.isTermName then
@@ -796,7 +796,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
796
796
797
797
if qual1.tpe.isSmallGenericTuple then
798
798
gadts.println(i " Tuple member selection healed by GADT approximation " )
799
- return typedSelect (tree, pt, qual1)
799
+ return typedSelectWithAdapt (tree, pt, qual1)
800
800
801
801
val tree2 = tryExtensionOrConversion(tree1, pt, IgnoredProto (pt), qual1, ctx.typerState.ownedVars, this , inSelect = true )
802
802
if ! tree2.isEmpty then
@@ -805,7 +805,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
805
805
// Otherwise, if there are uninstantiated type variables in the qualifier type,
806
806
// instantiate them and try again
807
807
if canDefineFurther(qual.tpe.widen) then
808
- return typedSelect (tree, pt, qual)
808
+ return typedSelectWithAdapt (tree, pt, qual)
809
809
810
810
def dynamicSelect (pt : Type ) =
811
811
val tree2 = cpy.Select (tree0)(untpd.TypedSplice (qual), selName)
@@ -854,7 +854,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
854
854
inaccessibleErrorType(rawType, superAccess, tree.srcPos)
855
855
case _ =>
856
856
notAMemberErrorType(tree, qual, pt))
857
- end typedSelect
857
+ end typedSelectWithAdapt
858
858
859
859
/** Expand a selection A.m on a context bound companion A with type
860
860
* `<context-bound-companion>[ref_1 | ... | ref_N]` as described by
@@ -906,7 +906,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
906
906
case witness : TermRef =>
907
907
val altQual = tpd.ref(witness).withSpan(qual.span)
908
908
val altCtx = ctx.fresh.setNewTyperState()
909
- val alt = typedSelect (tree, pt, altQual)(using altCtx)
909
+ val alt = typedSelectWithAdapt (tree, pt, altQual)(using altCtx)
910
910
def current = (alt, altCtx.typerState, witness)
911
911
if altCtx.reporter.hasErrors then prevs
912
912
else
@@ -938,7 +938,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
938
938
if ctx.isJava then
939
939
javaSelection(qual)
940
940
else
941
- typedSelect (tree, pt, qual).withSpan(tree.span).computeNullable()
941
+ typedSelectWithAdapt (tree, pt, qual).withSpan(tree.span).computeNullable()
942
942
943
943
def javaSelection (qual : Tree )(using Context ) =
944
944
val tree1 = assignType(cpy.Select (tree)(qual, tree.name), qual)
@@ -3879,7 +3879,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3879
3879
if isExtension then return found
3880
3880
else
3881
3881
checkImplicitConversionUseOK(found, selProto)
3882
- return withoutMode(Mode .ImplicitsEnabled )(typedSelect (tree, pt, found))
3882
+ return withoutMode(Mode .ImplicitsEnabled )(typedSelectWithAdapt (tree, pt, found))
3883
3883
case failure : SearchFailure =>
3884
3884
if failure.isAmbiguous then
3885
3885
return
0 commit comments