File tree 2 files changed +567
-1
lines changed
src/compiler/scala/tools/nsc/transform/patmat
test/junit/scala/tools/nsc/transform/patmat
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 {
122
122
123
123
// symbols are propositions
124
124
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
+
125
136
private val id : Int = Sym .nextSymId
126
137
127
- override def toString = variable + " = " + const + " # " + id
138
+ override def toString = s " $variable = $ const# $id "
128
139
}
129
140
130
141
object Sym {
You can’t perform that action at this time.
0 commit comments