diff options
author | buraq <buraq@epfl.ch> | 2004-06-04 12:30:31 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2004-06-04 12:30:31 +0000 |
commit | 4ff7dbf5b91afaa82d79942d0ed6852887571e50 (patch) | |
tree | 7a9cf108fa911e8948b011a63cb71c7f363e9f25 /sources | |
parent | ce4346489cc16774255bba385a675ded819b6d7d (diff) | |
download | scala-4ff7dbf5b91afaa82d79942d0ed6852887571e50.tar.gz scala-4ff7dbf5b91afaa82d79942d0ed6852887571e50.tar.bz2 scala-4ff7dbf5b91afaa82d79942d0ed6852887571e50.zip |
commit 2
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/transformer/matching/Autom2Scala.java | 5 | ||||
-rw-r--r-- | sources/scalac/transformer/matching/TestRegTraverser.java | 16 |
2 files changed, 8 insertions, 13 deletions
diff --git a/sources/scalac/transformer/matching/Autom2Scala.java b/sources/scalac/transformer/matching/Autom2Scala.java index a9c6af5cdb..c61a8cf420 100644 --- a/sources/scalac/transformer/matching/Autom2Scala.java +++ b/sources/scalac/transformer/matching/Autom2Scala.java @@ -187,10 +187,7 @@ public class Autom2Scala { /** some error happened which is due to bug in translation/automaton */ final Tree code_error() { - return gen.mkBlock( - gen.Console_print( pos, "System error during pattern matching. Please file bug report\n"), - cf.ThrowMatchError( pos, funRetType() ) - ); + return cf.ThrowMatchError( pos, funRetType() ); } Tree code_fail() { diff --git a/sources/scalac/transformer/matching/TestRegTraverser.java b/sources/scalac/transformer/matching/TestRegTraverser.java index e6d606e8c9..27c1f0a034 100644 --- a/sources/scalac/transformer/matching/TestRegTraverser.java +++ b/sources/scalac/transformer/matching/TestRegTraverser.java @@ -27,7 +27,10 @@ public class TestRegTraverser extends Traverser { case Alternative(_): result = true; break; - case Bind(_, Tree pat): + case Bind(Name n, Tree pat): + if( TreeInfo.isNameOfStarPattern( n ) ) { + result = true; + } if( TreeInfo.isEmptySequence( pat ) ) { // annoying special case: b@() [or b@(()|()) after normalization] //System.err.println("bindin empty "+tree.symbol()); @@ -67,17 +70,12 @@ public class TestRegTraverser extends Traverser { case Sequence( Tree[] trees3 ): result = true; break; - default: - super.traverse( tree ); - }; + } //System.out.println( fn ); //System.out.println( tree.type() ); - } else if( trees.length > 0 ) - super.traverse( tree ); - break; - default: - super.traverse( tree ); + } } + if( !result ) super.traverse( tree ); break; default: super.traverse( tree ); |