diff options
author | Matthias Zenger <mzenger@gmail.com> | 2003-11-20 11:06:53 +0000 |
---|---|---|
committer | Matthias Zenger <mzenger@gmail.com> | 2003-11-20 11:06:53 +0000 |
commit | 2c435db44a155f63f6cb3600ddb6db7359f8285f (patch) | |
tree | ceb2541e13f71f0a897969e2726ac4d783c30016 | |
parent | c738ff1ae87f1977095f3dcd0f6fb0e0216c6f75 (diff) | |
download | scala-2c435db44a155f63f6cb3600ddb6db7359f8285f.tar.gz scala-2c435db44a155f63f6cb3600ddb6db7359f8285f.tar.bz2 scala-2c435db44a155f63f6cb3600ddb6db7359f8285f.zip |
Removed dead code check.
-rw-r--r-- | sources/scalac/transformer/matching/PatternMatcher.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/sources/scalac/transformer/matching/PatternMatcher.java b/sources/scalac/transformer/matching/PatternMatcher.java index ebd38020d7..c69d3b98b9 100644 --- a/sources/scalac/transformer/matching/PatternMatcher.java +++ b/sources/scalac/transformer/matching/PatternMatcher.java @@ -203,20 +203,22 @@ public class PatternMatcher extends PatternTool { } protected void updateBody(Body tree, ValDef[] bound, Tree guard, Tree body) { - if (tree.guard[tree.guard.length - 1] == Tree.Empty) - unit.error(body.pos, "unreachable code"); - ValDef[][] bd = new ValDef[tree.bound.length + 1][]; - Tree[] ng = new Tree[tree.guard.length + 1]; - Tree[] nb = new Tree[tree.body.length + 1]; - System.arraycopy(tree.bound, 0, bd, 0, tree.bound.length); - System.arraycopy(tree.guard, 0, ng, 0, tree.guard.length); - System.arraycopy(tree.body, 0, nb, 0, tree.body.length); - bd[bd.length - 1] = bound; - ng[ng.length - 1] = guard; - nb[nb.length - 1] = body; - tree.bound = bd; - tree.guard = ng; - tree.body = nb; + if (tree.guard[tree.guard.length - 1] == Tree.Empty) { + //unit.error(body.pos, "unreachable code"); + } else { + ValDef[][] bd = new ValDef[tree.bound.length + 1][]; + Tree[] ng = new Tree[tree.guard.length + 1]; + Tree[] nb = new Tree[tree.body.length + 1]; + System.arraycopy(tree.bound, 0, bd, 0, tree.bound.length); + System.arraycopy(tree.guard, 0, ng, 0, tree.guard.length); + System.arraycopy(tree.body, 0, nb, 0, tree.body.length); + bd[bd.length - 1] = bound; + ng[ng.length - 1] = guard; + nb[nb.length - 1] = body; + tree.bound = bd; + tree.guard = ng; + tree.body = nb; + } } /* |