summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/transformer/UnCurry.java42
1 files changed, 3 insertions, 39 deletions
diff --git a/sources/scalac/transformer/UnCurry.java b/sources/scalac/transformer/UnCurry.java
index 698b0dbefe..1f17e47a49 100644
--- a/sources/scalac/transformer/UnCurry.java
+++ b/sources/scalac/transformer/UnCurry.java
@@ -237,8 +237,9 @@ public class UnCurry extends OwnerTransformer
}
/** converts `a_1,...,a_n' to Seq(a_1,...,a_n)
- * if a_n is an escaped sequence as in x:_*, takes care of
+ * if a_1 is an escaped sequence as in x:_*, takes care of
* escaping
+ */
private Tree[] toSequence(int pos, Symbol[] params, Tree[] args) {
Tree[] result = new Tree[params.length];
for (int i = 0; i < params.length - 1; i++)
@@ -246,36 +247,7 @@ public class UnCurry extends OwnerTransformer
assert (args.length != params.length
|| !(args[params.length-1] instanceof Tree.Sequence)
|| TreeInfo.isSequenceValued(args[params.length-1]));
- if (args.length == params.length) {
- switch (args[params.length-1]) {
- case Typed(Tree arg, Ident(TypeNames.WILDCARD_STAR)):
- result[params.length-1] = arg;
- return result;
- }
- //}
- Tree[] args1 = args;
- if (params.length != 1) {
- args1 = new Tree[args.length - (params.length - 1)];
- System.arraycopy(args, params.length - 1, args1, 0, args1.length);
- }
- result[params.length-1] =
- make.Sequence(pos, args1).setType(params[params.length-1].type());
- return result;
- }
- */
-
- /** converts `a_1,...,a_n' to Seq(a_1,...,a_n)
- * if a_n is an escaped sequence as in x:_*, takes care of
- * escaping
- */
- private Tree[] toSequence(int pos, Symbol[] params, Tree[] args) {
- Tree[] result = new Tree[params.length];
- for (int i = 0; i < params.length - 1; i++)
- result[i] = args[i];
- assert ( args.length != params.length )
- || !(args[params.length-1] instanceof Tree.Sequence)
- || TreeInfo.isSequenceValued(args[params.length-1]);
- if (args.length == params.length) {
+ if (args.length == params.length) {
switch (args[params.length-1]) {
case Typed(Tree arg, Ident(TypeNames.WILDCARD_STAR)):
result[params.length-1] = arg;
@@ -287,14 +259,6 @@ public class UnCurry extends OwnerTransformer
args1 = new Tree[args.length - (params.length - 1)];
System.arraycopy(args, params.length - 1, args1, 0, args1.length);
}
-
- if ( args.length>0 )
- switch (args[args1.length-1]) {
- case Typed(Tree arg, Ident(TypeNames.WILDCARD_STAR)):
- // unit is null ???!
- throw new ApplicationError( "not allowed to mix escape :_* with values"+unit);
- }
-
result[params.length-1] =
make.Sequence(pos, args1).setType(params[params.length-1].type());
return result;