summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index e447921beb..769174aead 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -609,7 +609,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast.
* @param pt ...
* @return the adapted tree
*/
- override protected def adapt(tree: Tree, mode: Int, pt: Type): Tree =
+ override protected def adapt(tree: Tree, mode: Int, pt: Type, original: Tree = EmptyTree): Tree =
adaptToType(tree, pt)
/** A replacement for the standard typer's `typed1' method */
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 &&