Skip to content

Commit a553078

Browse files
committed
Inlining: Constant-fold select trees
This fixes a pickling/unpickling difference in sip23-valueof.scala and makes sense in general.
1 parent acfe55c commit a553078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
10111011
override def typedSelect(tree: untpd.Select, pt: Type)(implicit ctx: Context): Tree = {
10121012
assert(tree.hasType, tree)
10131013
val qual1 = typed(tree.qualifier, selectionProto(tree.name, pt, this))
1014-
val res = untpd.cpy.Select(tree)(qual1, tree.name).withType(tree.typeOpt)
1014+
val res = constToLiteral(untpd.cpy.Select(tree)(qual1, tree.name).withType(tree.typeOpt))
10151015
ensureAccessible(res.tpe, tree.qualifier.isInstanceOf[untpd.Super], tree.sourcePos)
10161016
res
10171017
}

0 commit comments

Comments
 (0)