File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -173,10 +173,14 @@ class Pickler extends Phase {
173
173
cls -> (unit, unpickler)
174
174
}
175
175
pickling.println(" ************* entered toplevel ***********" )
176
+ val rootCtx = ctx
176
177
for ((cls, (unit, unpickler)) <- unpicklers) do
177
- ctx.compilationUnit.needsCaptureChecking = unit.needsCaptureChecking
178
178
val unpickled = unpickler.rootTrees
179
- testSame(i " $unpickled% \n % " , beforePickling(cls), cls)
179
+ val freshUnit = CompilationUnit (rootCtx.compilationUnit.source)
180
+ freshUnit.needsCaptureChecking = unit.needsCaptureChecking
181
+ freshUnit.knowsPureFuns = unit.knowsPureFuns
182
+ inContext(rootCtx.fresh.setCompilationUnit(freshUnit)):
183
+ testSame(i " $unpickled% \n % " , beforePickling(cls), cls)
180
184
181
185
private def testSame (unpickled : String , previous : String , cls : ClassSymbol )(using Context ) =
182
186
import java .nio .charset .StandardCharsets .UTF_8
You can’t perform that action at this time.
0 commit comments