File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/jvm Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,10 @@ class Interpreter[R <: Reflection & Singleton](reflect0: R) extends TreeInterpre
20
20
val parentSymbols = sym.tree.parents.tail.map(_.asInstanceOf [TypeTree ].symbol).head
21
21
import java .lang .reflect ._
22
22
val handler : InvocationHandler = new InvocationHandler () {
23
- val instance = new Object
24
23
25
24
def invoke (proxy : Object , method : Method , args : scala.Array [Object ]): Object = {
26
25
if (LOG ) {
27
- val proxyString = if (method.getName == " toString" ) method.invoke(instance ) else proxy.toString
26
+ val proxyString = if (method.getName == " toString" ) method.invoke(this ) else proxy.toString
28
27
println(s " %> proxy call ` $method` on ` $proxyString` with args= ${if (args == null ) Nil else args.toList}" )
29
28
}
30
29
@@ -42,8 +41,10 @@ class Interpreter[R <: Reflection & Singleton](reflect0: R) extends TreeInterpre
42
41
eval(symbol.tree.rhs.get)(env1).asInstanceOf [Object ]
43
42
}
44
43
}
45
- else
46
- method.invoke(instance, args : _* )
44
+ else {
45
+ assert(method.getClass == classOf [Object ])
46
+ method.invoke(this , args : _* )
47
+ }
47
48
}
48
49
49
50
}
You can’t perform that action at this time.
0 commit comments