Skip to content

Commit 83735b9

Browse files
committed
Revert to only mapping inferred types
1 parent cc92199 commit 83735b9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

compiler/src/dotty/tools/dotc/inlines/Inlines.scala

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,19 @@ object Inlines:
102102
*/
103103
def inlineCall(tree: Tree)(using Context): Tree = ctx.profiler.onInlineCall(tree.symbol):
104104

105-
/** Strip @retains annotations from types in the call tree */
106-
val cleanupRetains = new TreeTypeMap(typeMap = CleanupRetains())
107-
val tree0 = cleanupRetains.transform(tree)
105+
/** Strip @retains annotations from inferred types in the call tree */
106+
val stripRetains = CleanupRetains()
107+
val stripper = new TreeTypeMap(
108+
treeMap = {
109+
case tree: InferredTypeTree =>
110+
val stripped = stripRetains(tree.tpe)
111+
if stripped ne tree.tpe then tree.withType(stripped)
112+
else tree
113+
case tree => tree
114+
}
115+
)
116+
117+
val tree0 = stripper.transform(tree)
108118

109119
if tree0.symbol.denot.exists
110120
&& tree0.symbol.effectiveOwner == defn.CompiletimeTestingPackage.moduleClass

0 commit comments

Comments
 (0)