diff options
author | buraq <buraq@epfl.ch> | 2003-10-30 13:04:47 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-10-30 13:04:47 +0000 |
commit | 4764fc555502237fc7f423af4200520a975a69fd (patch) | |
tree | 06a83b5fb94954a22765f0226d414a17d03d335c /sources | |
parent | 29f2b9e84c3568a5644a78237be63918977db227 (diff) | |
download | scala-4764fc555502237fc7f423af4200520a975a69fd.tar.gz scala-4764fc555502237fc7f423af4200520a975a69fd.tar.bz2 scala-4764fc555502237fc7f423af4200520a975a69fd.zip |
Typed patterns x:T and variable patterns x are ...
Typed patterns x:T and variable patterns x are desugarized to x@ _ : T
resp x @ _.
thus some cases here become unnecessary
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/transformer/matching/PatternMatcher.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sources/scalac/transformer/matching/PatternMatcher.java b/sources/scalac/transformer/matching/PatternMatcher.java index 6445034f10..d3e24a3c69 100644 --- a/sources/scalac/transformer/matching/PatternMatcher.java +++ b/sources/scalac/transformer/matching/PatternMatcher.java @@ -325,9 +325,11 @@ public class PatternMatcher extends PatternTool { case Ident(Name name): // pattern without args or variable if (tree.symbol() == defs.PATTERN_WILDCARD) return mk.DefaultPat(tree.pos, header.type); - else if (tree.symbol().isPrimaryConstructor()) - return mk.ConstrPat(tree.pos, tree.type); - else if (name.isVariable()) { + else if (tree.symbol().isPrimaryConstructor()) { + assert false; // this may not happen ?? ----------------- Burak + return mk.ConstrPat(tree.pos, tree.type); + } else if (name.isVariable()) {// should be Bind ------------ Burak + assert false; if (env != null) env.newBoundVar( tree.symbol(), @@ -359,7 +361,7 @@ public class PatternMatcher extends PatternTool { return res; default: new scalac.ast.printer.TextTreePrinter().print(tree).flush(); - throw new ApplicationError(tree); + throw new ApplicationError("unit "+unit+" tree"+tree); } } |