File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
compiler/src/dotty/tools/dotc/inlines Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments