@@ -72,8 +72,7 @@ abstract class Interpreter(pos: SrcPos, classLoader: ClassLoader)(using Context)
72
72
else if (fn.symbol.is(Module ))
73
73
interpretModuleAccess(fn.symbol)
74
74
else if (fn.symbol.is(Method ) && fn.symbol.isStatic) {
75
- val staticMethodCall = interpretedStaticMethodCall(fn.symbol.owner, fn.symbol)
76
- staticMethodCall(interpretArgs(args, fn.symbol.info))
75
+ interpretedStaticMethodCall(fn.symbol.owner, fn.symbol, interpretArgs(args, fn.symbol.info))
77
76
}
78
77
else if fn.symbol.isStatic then
79
78
assert(args.isEmpty)
@@ -82,8 +81,7 @@ abstract class Interpreter(pos: SrcPos, classLoader: ClassLoader)(using Context)
82
81
if (fn.name == nme.asInstanceOfPM)
83
82
interpretModuleAccess(fn.qualifier.symbol)
84
83
else {
85
- val staticMethodCall = interpretedStaticMethodCall(fn.qualifier.symbol.moduleClass, fn.symbol)
86
- staticMethodCall(interpretArgs(args, fn.symbol.info))
84
+ interpretedStaticMethodCall(fn.qualifier.symbol.moduleClass, fn.symbol, interpretArgs(args, fn.symbol.info))
87
85
}
88
86
else if (env.contains(fn.symbol))
89
87
env(fn.symbol)
@@ -157,7 +155,7 @@ abstract class Interpreter(pos: SrcPos, classLoader: ClassLoader)(using Context)
157
155
private def interpretVarargs (args : List [Object ]): Object =
158
156
args.toSeq
159
157
160
- private def interpretedStaticMethodCall (moduleClass : Symbol , fn : Symbol ) : List [Object ] => Object = {
158
+ private def interpretedStaticMethodCall (moduleClass : Symbol , fn : Symbol , args : List [Object ]) : Object = {
161
159
val (inst, clazz) =
162
160
try
163
161
if (moduleClass.name.startsWith(str.REPL_SESSION_LINE ))
@@ -174,7 +172,7 @@ abstract class Interpreter(pos: SrcPos, classLoader: ClassLoader)(using Context)
174
172
175
173
val name = fn.name.asTermName
176
174
val method = getMethod(clazz, name, paramsSig(fn))
177
- ( args : List [ Object ]) => stopIfRuntimeException(method.invoke(inst, args : _* ), method)
175
+ stopIfRuntimeException(method.invoke(inst, args : _* ), method)
178
176
}
179
177
180
178
private def interpretedStaticFieldAccess (sym : Symbol ): Object = {
0 commit comments