Skip to content

Commit 08c3e81

Browse files
committed
Fix new tests after merge
# Conflicts: # tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala # tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala
1 parent 262d5f9 commit 08c3e81

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

language-server/test/dotty/tools/languageserver/util/CodeTester.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class CodeTester(projects: List[Project]) {
237237

238238
private def doAction(action: Action): this.type = {
239239
try {
240-
action.execute() with (testServer, testServer.client, positions)
240+
action.execute() given (testServer, testServer.client, positions)
241241
} catch {
242242
case ex: AssertionError =>
243243
val sourcesStr =
@@ -252,7 +252,7 @@ class CodeTester(projects: List[Project]) {
252252
|
253253
|$sourcesStr
254254
|
255-
|while executing action: ${action.show with positions}
255+
|while executing action: ${action.show given positions}
256256
|
257257
""".stripMargin
258258
val assertionError = new AssertionError(msg + ex.getMessage)

tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TastyInterpreter extends TastyConsumer {
1414
case DefDef("main", _, _, _, Some(rhs)) =>
1515
val interpreter = new jvm.Interpreter(reflect)
1616

17-
interpreter.eval(rhs) with Map.empty
17+
interpreter.eval(rhs) given Map.empty
1818
// TODO: recurse only for PackageDef, ClassDef
1919
case tree =>
2020
super.traverseTree(tree)

tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ abstract class TreeInterpreter[R <: Reflection & Singleton](val reflect: R) {
1313
/** Representation of objects and values in the interpreter */
1414
type AbstractAny
1515

16-
type Result = Env |=> AbstractAny
16+
type Result = given Env => AbstractAny
1717

1818
def localValue(sym: Symbol)(implicit env: Env): LocalValue = env(sym)
1919

20-
def withLocalValue[T](sym: Symbol, value: LocalValue)(in: Env |=> T)(implicit env: Env): T =
21-
in with env.updated(sym, value)
20+
def withLocalValue[T](sym: Symbol, value: LocalValue)(in: given Env => T)(implicit env: Env): T =
21+
in given env.updated(sym, value)
2222

23-
def withLocalValues[T](syms: List[Symbol], values: List[LocalValue])(in: Env |=> T)(implicit env: Env): T =
24-
in with (env ++ syms.zip(values))
23+
def withLocalValues[T](syms: List[Symbol], values: List[LocalValue])(in: given Env => T)(implicit env: Env): T =
24+
in given (env ++ syms.zip(values))
2525

2626
def interpretCall(inst: AbstractAny, sym: DefSymbol, args: List[AbstractAny]): Result = {
2727
// TODO
@@ -65,7 +65,7 @@ abstract class TreeInterpreter[R <: Reflection & Singleton](val reflect: R) {
6565
def interpretBlock(stats: List[Statement], expr: Term): Result = {
6666
val newEnv = stats.foldLeft(implicitly[Env])((accEnv, stat) => stat match {
6767
case ValDef(name, tpt, Some(rhs)) =>
68-
def evalRhs = eval(rhs) with accEnv
68+
def evalRhs = eval(rhs) given accEnv
6969
val evalRef: LocalValue =
7070
if (stat.symbol.flags.is(Flags.Lazy)) LocalValue.lazyValFrom(evalRhs)
7171
else if (stat.symbol.flags.is(Flags.Mutable)) LocalValue.varFrom(evalRhs)
@@ -76,10 +76,10 @@ abstract class TreeInterpreter[R <: Reflection & Singleton](val reflect: R) {
7676
// TODO: record the environment for closure purposes
7777
accEnv
7878
case stat =>
79-
eval(stat) with accEnv
79+
eval(stat) given accEnv
8080
accEnv
8181
})
82-
eval(expr) with newEnv
82+
eval(expr) given newEnv
8383
}
8484

8585
def interpretUnit(): AbstractAny

0 commit comments

Comments
 (0)