Skip to content

Commit 3d68bba

Browse files
committed
Only strip ascriptions in nested inline calls
1 parent 6ae39ef commit 3d68bba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ class Inliner(val call: tpd.Tree)(using Context):
10501050
private def shouldStripAscription(tree: Typed)(using Context): Boolean =
10511051
val exprTp = tree.expr.tpe
10521052
tree.hasAttachment(PrepareInlineable.InlineResultAscription)
1053+
&& enclosingInlineds.size > 1
10531054
&& exprTp.exists
10541055
&& !exprTp.widen.isRef(defn.NothingClass)
10551056
&& !exprTp.widen.isRef(defn.NullClass)

0 commit comments

Comments
 (0)