@@ -295,8 +295,12 @@ object Splicer {
295295 case _ if tree.symbol == defn.TastyTasty_macroContext =>
296296 interpretTastyContext()
297297
298- case StaticCall (fn, args) =>
299- if (fn.symbol.is(Module )) {
298+ case Call (fn, args) =>
299+ if (fn.symbol.isConstructor && fn.symbol.owner.owner.is(Package )) {
300+ interpretNew(fn, args.map(interpretTree))
301+ } else if (! fn.symbol.isStatic ) {
302+ unexpectedTree(tree)
303+ } else if (fn.symbol.is(Module )) {
300304 assert(args.isEmpty)
301305 interpretModuleAccess(fn)
302306 } else {
@@ -317,11 +321,6 @@ object Splicer {
317321
318322 case Inlined (EmptyTree , Nil , expansion) => interpretTree(expansion)
319323
320- case Apply (TypeApply (fun : RefTree , _), args) if fun.symbol.isConstructor && fun.symbol.owner.owner.is(Package ) =>
321- interpretNew(fun, args.map(interpretTree))
322-
323- case Apply (fun : RefTree , args) if fun.symbol.isConstructor && fun.symbol.owner.owner.is(Package )=>
324- interpretNew(fun, args.map(interpretTree))
325324
326325 case Typed (SeqLiteral (elems, _), _) =>
327326 interpretVarargs(elems.map(e => interpretTree(e)))
@@ -330,11 +329,11 @@ object Splicer {
330329 unexpectedTree(tree)
331330 }
332331
333- object StaticCall {
332+ object Call {
334333 def unapply (arg : Tree ): Option [(RefTree , List [Tree ])] = arg match {
335- case fn : RefTree if fn.symbol.isStatic => Some ((fn, Nil ))
336- case Apply (StaticCall (fn, args1), args2) => Some ((fn, args1 ::: args2)) // TODO improve performance
337- case TypeApply (StaticCall (fn, args), _) => Some ((fn, args))
334+ case fn : RefTree => Some ((fn, Nil ))
335+ case Apply (Call (fn, args1), args2) => Some ((fn, args1 ::: args2)) // TODO improve performance
336+ case TypeApply (Call (fn, args), _) => Some ((fn, args))
338337 case _ => None
339338 }
340339 }
0 commit comments