From e8aee14bbdefe2936d17520a9bb53d16ebc487de Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 12 Sep 2011 14:14:15 +0000 Subject: Fix for params/args zip IOOB crash. --- src/compiler/scala/reflect/internal/TreeInfo.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler/scala/reflect/internal/TreeInfo.scala b/src/compiler/scala/reflect/internal/TreeInfo.scala index 248cee8de8..6ee976a55d 100644 --- a/src/compiler/scala/reflect/internal/TreeInfo.scala +++ b/src/compiler/scala/reflect/internal/TreeInfo.scala @@ -116,7 +116,14 @@ abstract class TreeInfo { */ def zipMethodParamsAndArgs(t: Tree): List[(Symbol, Tree)] = t match { case Apply(fn, args) => - val params = fn.symbol.paramss(applyDepth(fn)) + val depth = applyDepth(fn) + // There could be applies which go beyond the parameter list(s), + // being applied to the result of the method call. + val params = ( + if (depth < fn.symbol.paramss.size) fn.symbol.paramss(depth) + else if (fn.symbol.paramss.isEmpty) Nil + else fn.symbol.paramss.last + ) val plen = params.length val alen = args.length def fail() = { -- cgit v1.2.3