Skip to content

Commit 3070bb3

Browse files
Address review
1 parent c4ae7e9 commit 3070bb3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compiler/src/dotty/tools/dotc/transform/Splicer.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,12 @@ object Splicer {
193193
val staticMethodCall = interpretedStaticMethodCall(fn.symbol.owner, fn.symbol)
194194
staticMethodCall(args.flatten.map(interpretTree))
195195
} else if (fn.qualifier.symbol.is(Module) && fn.qualifier.symbol.isStatic) {
196-
val staticMethodCall = interpretedStaticMethodCall(fn.qualifier.symbol.moduleClass, fn.symbol)
197-
staticMethodCall(args.flatten.map(interpretTree))
196+
if (fn.name == nme.asInstanceOfPM) {
197+
interpretModuleAccess(fn.qualifier.symbol)
198+
} else {
199+
val staticMethodCall = interpretedStaticMethodCall(fn.qualifier.symbol.moduleClass, fn.symbol)
200+
staticMethodCall(args.flatten.map(interpretTree))
201+
}
198202
} else if (env.contains(fn.name)) {
199203
env(fn.name)
200204
} else if (tree.symbol.is(InlineProxy)) {
@@ -264,12 +268,8 @@ object Splicer {
264268
}
265269

266270
val name = getDirectName(fn.info.finalResultType, fn.name.asTermName)
267-
if (name == nme.asInstanceOfPM)
268-
(args: List[Object]) => interpretModuleAccess(moduleClass)
269-
else {
270-
val method = getMethod(clazz, name, paramsSig(fn))
271-
(args: List[Object]) => stopIfRuntimeException(method.invoke(inst, args: _*))
272-
}
271+
val method = getMethod(clazz, name, paramsSig(fn))
272+
(args: List[Object]) => stopIfRuntimeException(method.invoke(inst, args: _*))
273273
}
274274

275275
private def interpretModuleAccess(fn: Symbol)(implicit env: Env): Object =

0 commit comments

Comments
 (0)