Skip to content

Commit

Permalink
Detail selectionType usage in Inliner typedSelect (#22358)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored Jan 13, 2025
2 parents af655c9 + f23f7c6 commit c5bf0e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compiler/src/dotty/tools/dotc/inlines/Inliner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,13 @@ class Inliner(val call: tpd.Tree)(using Context):
override def typedSelect(tree: untpd.Select, pt: Type)(using Context): Tree = {
val locked = ctx.typerState.ownedVars
val qual1 = typed(tree.qualifier, shallowSelectionProto(tree.name, pt, this, tree.nameSpan))
selectionType(tree, qual1) // side-effect

// Make sure that the named type has the correct denotation.
// For instance in tests/pos/i22070 when we type `Featureful[?]#toFeatures`,
// `selectionType` will skolemize the prefix, find the denotation,
// and then set that denotation for the `TermRef(Featureful[?], symbol toFeatures)`.
selectionType(tree, qual1)

val resNoReduce = untpd.cpy.Select(tree)(qual1, tree.name).withType(tree.typeOpt)
val reducedProjection = reducer.reduceProjection(resNoReduce)
if reducedProjection.isType then
Expand Down

0 comments on commit c5bf0e0

Please sign in to comment.