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