diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index ce955cee96c3..57ce74ab8638 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -729,8 +729,15 @@ class TreeUnpickler(reader: TastyReader, val localCtx = localContext(sym) def readRhs(implicit ctx: Context) = - if (nothingButMods(end)) EmptyTree - else readLater(end, rdr => ctx => rdr.readTerm()(ctx.retractMode(Mode.InSuperCall))) + if (nothingButMods(end)) + EmptyTree + else if (sym.isInlinedMethod) + // The body of an inline method is stored in an annotation, so no need to unpickle it again + new Trees.Lazy[Tree] { + def complete(implicit ctx: Context) = typer.Inliner.bodyToInline(sym) + } + else + readLater(end, rdr => ctx => rdr.readTerm()(ctx.retractMode(Mode.InSuperCall))) def ValDef(tpt: Tree) = ta.assignType(untpd.ValDef(sym.name.asTermName, tpt, readRhs(localCtx)), sym)