Skip to content

Commit c5bf0e0

Browse files
authored
Detail selectionType usage in Inliner typedSelect (#22358)
2 parents af655c9 + f23f7c6 commit c5bf0e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/inlines/Inliner.scala

+7-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,13 @@ class Inliner(val call: tpd.Tree)(using Context):
790790
override def typedSelect(tree: untpd.Select, pt: Type)(using Context): Tree = {
791791
val locked = ctx.typerState.ownedVars
792792
val qual1 = typed(tree.qualifier, shallowSelectionProto(tree.name, pt, this, tree.nameSpan))
793-
selectionType(tree, qual1) // side-effect
793+
794+
// Make sure that the named type has the correct denotation.
795+
// For instance in tests/pos/i22070 when we type `Featureful[?]#toFeatures`,
796+
// `selectionType` will skolemize the prefix, find the denotation,
797+
// and then set that denotation for the `TermRef(Featureful[?], symbol toFeatures)`.
798+
selectionType(tree, qual1)
799+
794800
val resNoReduce = untpd.cpy.Select(tree)(qual1, tree.name).withType(tree.typeOpt)
795801
val reducedProjection = reducer.reduceProjection(resNoReduce)
796802
if reducedProjection.isType then

0 commit comments

Comments
 (0)