Skip to content

Commit 75a9813

Browse files
committed
Inline unapplys in the inlining phase
These currently got inlined while typing. Therefore they used to generate code that should not be pickled.
1 parent 551eae4 commit 75a9813

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/src/dotty/tools/dotc/transform/Inlining.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ class Inlining extends MacroTransform, IdentityDenotTransformer {
9090
else super.transform(tree)
9191
case _: Typed | _: Block =>
9292
super.transform(tree)
93+
case tree: UnApply =>
94+
tree match
95+
case tree1: UnApply if Inlines.needsInlining(tree1) =>
96+
super.transform(cpy.UnApply(tree1)(fun = Inlines.inlinedUnapplyFun(tree1.fun)))
97+
case tree1 => super.transform(tree1)
9398
case _ if Inlines.needsInlining(tree) =>
9499
val tree1 = super.transform(tree)
95100
if tree1.tpe.isError then tree1

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,9 +1937,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19371937
if (bounds != null) sym.info = bounds
19381938
}
19391939
b
1940-
case t: UnApply if t.symbol.is(Inline) =>
1941-
assert(!t.symbol.is(Transparent))
1942-
cpy.UnApply(t)(fun = Inlines.inlinedUnapplyFun(t.fun)) // TODO inline these in the inlining phase (see #19382)
19431940
case t => t
19441941
}
19451942
}

0 commit comments

Comments
 (0)