summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/UnCurry.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-09-28 11:09:14 +0000
committerMartin Odersky <odersky@gmail.com>2009-09-28 11:09:14 +0000
commit53d98e7d421d55054fb0bcb606539fc36364bebf (patch)
treebe6b68360458b97ab92a0dc3e963f365ae5acd95 /src/compiler/scala/tools/nsc/transform/UnCurry.scala
parent32cac0e3fde4a512d7322cd60146bdac7d1898d4 (diff)
downloadscala-53d98e7d421d55054fb0bcb606539fc36364bebf.tar.gz
scala-53d98e7d421d55054fb0bcb606539fc36364bebf.tar.bz2
scala-53d98e7d421d55054fb0bcb606539fc36364bebf.zip
refined implicit resolution.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/UnCurry.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index f03b7d5096..12711a36c6 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -410,17 +410,22 @@ abstract class UnCurry extends InfoTransform with TypingTransformers {
}
}
+ val lastElemType = lastFormal.typeArgs.head
var suffix: Tree =
if (!args.isEmpty && (treeInfo isWildcardStarArg args.last)) {
val Typed(tree, _) = args.last;
- if (isJava && !(tree.tpe.typeSymbol == ArrayClass) && (tree.tpe.typeSymbol isSubClass TraversableClass)) sequenceToArray(tree)
- else tree
+ if (isJava)
+ if (tree.tpe.typeSymbol == ArrayClass) tree
+ else sequenceToArray(tree)
+ else
+ if (tree.tpe.typeSymbol isSubClass TraversableClass) tree
+ else arrayToSequence(tree, lastElemType)
} else {
- val lastElemType = lastFormal.typeArgs.head
val tree = mkArrayValue(args drop (formals.length - 1), lastElemType)
if (isJava || inPattern) tree
else arrayToSequence(tree, lastElemType)
}
+
atPhase(phase.next) {
if (isJava &&
suffix.tpe.typeSymbol == ArrayClass &&