Skip to content

Commit e2b18ff

Browse files
committed
Rename to typedSelectWithAdapt
[Cherry-picked 6230405][modified]
1 parent cfb98d9 commit e2b18ff

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
681681
then
682682
report.error(StableIdentPattern(tree, pt), tree.srcPos)
683683

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 =
685685
val selName = tree0.name
686686
val tree = cpy.Select(tree0)(qual, selName)
687687
val superAccess = qual.isInstanceOf[Super]
@@ -703,10 +703,10 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
703703
// there's a simply visible type variable in the result; try again with a more defined qualifier type
704704
// There's a second trial where we try to instantiate all type variables in `qual.tpe.widen`,
705705
// but that is done only after we search for extension methods or conversions.
706-
typedSelect(tree, pt, qual)
706+
typedSelectWithAdapt(tree, pt, qual)
707707
else if qual.tpe.isSmallGenericTuple then
708708
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)))
710710
else
711711
val tree1 = tryExtensionOrConversion(
712712
tree, pt, IgnoredProto(pt), qual, ctx.typerState.ownedVars, this, inSelect = true)
@@ -728,15 +728,15 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
728728
finish(tree1, qual1, checkedType1)
729729
else if qual1.tpe.isSmallGenericTuple then
730730
gadts.println(i"Tuple member selection healed by GADT approximation")
731-
typedSelect(tree, pt, qual1)
731+
typedSelectWithAdapt(tree, pt, qual1)
732732
else
733733
tryExtensionOrConversion(tree1, pt, IgnoredProto(pt), qual1, ctx.typerState.ownedVars, this, inSelect = true)
734734
else EmptyTree
735735
}
736736
if !tree1.isEmpty then
737737
tree1
738738
else if canDefineFurther(qual.tpe.widen) then
739-
typedSelect(tree, pt, qual)
739+
typedSelectWithAdapt(tree, pt, qual)
740740
else if qual.tpe.derivesFrom(defn.DynamicClass)
741741
&& selName.isTermName && !isDynamicExpansion(tree)
742742
then
@@ -752,14 +752,14 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
752752
inaccessibleErrorType(rawType, superAccess, tree.srcPos)
753753
case _ =>
754754
notAMemberErrorType(tree, qual, pt))
755-
end typedSelect
755+
end typedSelectWithAdapt
756756

757757
def typedSelect(tree: untpd.Select, pt: Type)(using Context): Tree = {
758758
record("typedSelect")
759759

760760
def typeSelectOnTerm(using Context): Tree =
761761
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()
763763

764764
def javaSelectOnType(qual: Tree)(using Context) =
765765
// semantic name conversion for `O$` in java code
@@ -3563,7 +3563,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
35633563
if isExtension then return found
35643564
else
35653565
checkImplicitConversionUseOK(found, selProto)
3566-
return withoutMode(Mode.ImplicitsEnabled)(typedSelect(tree, pt, found))
3566+
return withoutMode(Mode.ImplicitsEnabled)(typedSelectWithAdapt(tree, pt, found))
35673567
case failure: SearchFailure =>
35683568
if failure.isAmbiguous then
35693569
return

0 commit comments

Comments
 (0)