summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2003-12-04 09:21:32 +0000
committerschinz <schinz@epfl.ch>2003-12-04 09:21:32 +0000
commit0c3462a399a8c34fe61c07bfd8d50628368682d5 (patch)
treed26aa1bc70d01681c74114b0b45e55dac08a8caf /sources
parentd305f5fbe6866fd24f0e71fe5e6a8b9d6f9f8da2 (diff)
downloadscala-0c3462a399a8c34fe61c07bfd8d50628368682d5.tar.gz
scala-0c3462a399a8c34fe61c07bfd8d50628368682d5.tar.bz2
scala-0c3462a399a8c34fe61c07bfd8d50628368682d5.zip
- reverted back to version 1.27 for now, as 1.2...
- reverted back to version 1.27 for now, as 1.28 prevents bootstraping
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;