File tree Expand file tree Collapse file tree 2 files changed +567
-1
lines changed
src/compiler/scala/tools/nsc/transform/patmat
test/junit/scala/tools/nsc/transform/patmat Expand file tree Collapse file tree 2 files changed +567
-1
lines changed Original file line number Diff line number Diff line change @@ -122,9 +122,20 @@ trait Logic extends Debugging {
122122
123123 // symbols are propositions
124124 final class Sym private [PropositionalLogic ] (val variable : Var , val const : Const ) extends Prop {
125+
126+ override def equals (other : scala.Any ): Boolean = other match {
127+ case that : Sym => this .variable == that.variable &&
128+ this .const == that.const
129+ case _ => false
130+ }
131+
132+ override def hashCode (): Int = {
133+ variable.hashCode * 41 + const.hashCode
134+ }
135+
125136 private val id : Int = Sym .nextSymId
126137
127- override def toString = variable + " = " + const + " # " + id
138+ override def toString = s " $variable = $ const# $id "
128139 }
129140
130141 object Sym {
You can’t perform that action at this time.
0 commit comments