Skip to content

Commit cc92199

Browse files
committed
Simplify retains annotation cleanup at inlineCall
1 parent 63ec012 commit cc92199

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

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

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

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

120-
if tree0.symbol.denot != SymDenotations.NoDenotation
109+
if tree0.symbol.denot.exists
121110
&& tree0.symbol.effectiveOwner == defn.CompiletimeTestingPackage.moduleClass
122111
then
123112
if (tree0.symbol == defn.CompiletimeTesting_typeChecks) return Intrinsics.typeChecks(tree0)

0 commit comments

Comments
 (0)