diff options
author | buraq <buraq@epfl.ch> | 2003-09-26 13:19:43 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-09-26 13:19:43 +0000 |
commit | bb0022e6f6111b017e77042cce2ec5736edbaccc (patch) | |
tree | 1e2333d5469b606819df3396af9329e56527820b /sources/scalac/transformer/matching/Label.java | |
parent | 7a10026f29d2992b45e367e9a607b569cb448cbb (diff) | |
download | scala-bb0022e6f6111b017e77042cce2ec5736edbaccc.tar.gz scala-bb0022e6f6111b017e77042cce2ec5736edbaccc.tar.bz2 scala-bb0022e6f6111b017e77042cce2ec5736edbaccc.zip |
fixed hashing of patterns
Diffstat (limited to 'sources/scalac/transformer/matching/Label.java')
-rw-r--r-- | sources/scalac/transformer/matching/Label.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sources/scalac/transformer/matching/Label.java b/sources/scalac/transformer/matching/Label.java index 389139da0a..4c41f8a031 100644 --- a/sources/scalac/transformer/matching/Label.java +++ b/sources/scalac/transformer/matching/Label.java @@ -1,6 +1,7 @@ package scalac.transformer.matching ; import scalac.ast.Tree ; +import scalac.ast.TreeInfo ; import scalac.symtab.Type ; import Tree.Literal ; @@ -28,6 +29,10 @@ public class Label { case SimpleLabel( Literal lit ): return lit.value.hashCode(); case TreeLabel( Tree pat ): + switch( pat ) { + case Apply( _, Tree[] args ): + return TreeInfo.methSymbol( pat ).hashCode() + args.hashCode(); // incorrect? + } return pat.hashCode(); case TypeLabel( Type type ): return type.hashCode(); @@ -57,8 +62,15 @@ public class Label { break; case TreeLabel( Tree pat ): switch( oL ) { - case TreeLabel( Tree pat2): - return pat == pat2; + case TreeLabel( Tree pat2 ): + switch( pat ) { + case Apply( _, _ ): + switch( pat2 ) { + case Apply( _, _ ): + return TreeInfo.methSymbol( pat ) == TreeInfo.methSymbol( pat2 ); + } + } + return pat == pat2; } break ; case TypeLabel( Type tpe ): |