@@ -4,7 +4,7 @@ import dotty.tools.dotc.ast.tpd
44import dotty .tools .dotc .ast .tpd .TreeOps
55import dotty .tools .dotc .{Driver , Main }
66import dotty .tools .dotc .core .Comments .CommentsContext
7- import dotty .tools .dotc .core .Contexts .Context
7+ import dotty .tools .dotc .core .Contexts ._
88import dotty .tools .dotc .core .Decorators .PreNamedString
99import dotty .tools .dotc .core .Mode
1010import dotty .tools .dotc .core .Names .Name
@@ -59,6 +59,7 @@ class CommentPicklingTest {
5959
6060 private def compileAndCheckComment (sources : List [String ], treeName : Name , expectedComment : Option [String ]): Unit = {
6161 compileAndUnpickle(sources) { (trees, ctx) =>
62+ given CState = ctx.cstate
6263 findTreeNamed(treeName)(trees, ctx) match {
6364 case Some (md : tpd.MemberDef ) =>
6465 val symbol = md.symbol(using ctx)
@@ -73,6 +74,7 @@ class CommentPicklingTest {
7374
7475 private def findTreeNamed (name : Name )(trees : List [tpd.Tree ], ctx : Context ): Option [tpd.MemberDef ] = {
7576 implicit val _ctx : Context = ctx
77+ given CState = ctx.cstate
7678 trees.flatMap { _.find { case md : tpd.MemberDef => md.name == name; case _ => false }
7779 .map(_.asInstanceOf [tpd.MemberDef ]).toList
7880 }.headOption
@@ -108,6 +110,7 @@ class CommentPicklingTest {
108110 override def initCtx = super .initCtx.addMode(Mode .ReadComments )
109111 def unpickle [T ](args : Array [String ], files : List [File ])(fn : (List [tpd.Tree ], Context ) => T ): T = {
110112 implicit val (_, ctx : Context ) = setup(args, initCtx)
113+ given CState = ctx.cstate
111114 ctx.initialize()
112115 val trees = files.flatMap { f =>
113116 val unpickler = new DottyUnpickler (f.toByteArray())
0 commit comments