Skip to content

Commit 47218ef

Browse files
author
Alexey Romanov
committed
Add type comparison to Const.equals
1 parent 56b0d0e commit 47218ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/internal/Expressions.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ trait Expressions extends Utils {
2020
def pos: List[SourceContext] = Nil
2121
}
2222

23-
case class Const[+T:Manifest](x: T) extends Exp[T]
23+
case class Const[+T:Manifest](x: T) extends Exp[T] {
24+
override def equals(other: Any) = other match {
25+
case c: Const[_] => x == c.x && tp == c.tp
26+
case _ => false
27+
}
28+
}
2429

2530
case class Sym[+T:Manifest](val id: Int) extends Exp[T] {
2631
var sourceContexts: List[SourceContext] = Nil

0 commit comments

Comments
 (0)