Skip to content

Commit da3fe87

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 8d64f2d commit da3fe87

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

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

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

17-
interpreter.eval(rhs)(Map.empty)
17+
interpreter.eval(rhs) given Map.empty
1818
// TODO: recurse only for PackageDef, ClassDef
1919
case tree =>
2020
super.traverseTree(tree)
2121
}
2222
}
2323
Traverser.traverseTree(root)(reflect.rootContext)
2424
}
25-
}
25+
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ 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 = implicit 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: implicit Env => T)(implicit env: Env): T =
21-
in(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: implicit Env => T)(implicit env: Env): T =
24-
in(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

26-
def interpretCall(instance: AbstractAny, sym: DefSymbol, args: List[AbstractAny]): Result = {
26+
def interpretCall(inst: AbstractAny, sym: DefSymbol, args: List[AbstractAny]): Result = {
2727
// TODO
28-
// withLocalValue(`this`, instance) {
28+
// withLocalValue(`this`, inst) {
2929
val syms = sym.tree.paramss.headOption.getOrElse(Nil).map(_.symbol)
3030
withLocalValues(syms, args.map(LocalValue.valFrom(_))) {
3131
eval(sym.tree.rhs.get)
@@ -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)(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)(accEnv)
79+
eval(stat) given accEnv
8080
accEnv
8181
})
82-
eval(expr)(newEnv)
82+
eval(expr) given newEnv
8383
}
8484

8585
def interpretUnit(): AbstractAny

0 commit comments

Comments
 (0)