diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-12 14:14:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-12 14:14:15 +0000 |
commit | e8aee14bbdefe2936d17520a9bb53d16ebc487de (patch) | |
tree | e5bcca7bc009e1f15b40e8d2839a263a88be35cd /src/compiler | |
parent | aaaa019588d0c2b10d74f7c38fd9dee9f970404b (diff) | |
download | scala-e8aee14bbdefe2936d17520a9bb53d16ebc487de.tar.gz scala-e8aee14bbdefe2936d17520a9bb53d16ebc487de.tar.bz2 scala-e8aee14bbdefe2936d17520a9bb53d16ebc487de.zip |
Fix for params/args zip IOOB crash.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/reflect/internal/TreeInfo.scala | 9 |
1 files changed, 8 insertions, 1 deletions
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() = { |