Skip to content

Commit d6a621c

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 43ed9fd commit d6a621c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

+5
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

-3
Original file line numberDiff line numberDiff line change
@@ -1956,9 +1956,6 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
19561956
if (bounds != null) sym.info = bounds
19571957
}
19581958
b
1959-
case t: UnApply if t.symbol.is(Inline) =>
1960-
assert(!t.symbol.is(Transparent))
1961-
cpy.UnApply(t)(fun = Inlines.inlinedUnapplyFun(t.fun)) // TODO inline these in the inlining phase (see #19382)
19621959
case t => t
19631960
}
19641961
}

0 commit comments

Comments
 (0)