Skip to content

Commit

Permalink
Fixes an issue with ComparisonOperator.Less becoming a ComparisonOper…
Browse files Browse the repository at this point in the history
…ator.Greater when copied.
  • Loading branch information
Ralph Gasser committed Apr 8, 2024
1 parent d03add3 commit aa67213
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sealed interface ComparisonOperator: NodeWithCost, PreparableNode {
return left != null && right != null && left < right
}
override fun toString(): String = "$left < $right"
override fun copy() = Greater(this.left, this.right)
override fun copy() = Less(this.left, this.right)
override fun digest(): Digest = this.hashCode().toLong()
}

Expand Down Expand Up @@ -156,7 +156,7 @@ sealed interface ComparisonOperator: NodeWithCost, PreparableNode {
class Match(override val left: Binding, override val right: Binding) : ComparisonOperator {
context(BindingContext, Tuple)
override fun match() = throw UnsupportedOperationException("A MATCH comparison operator cannot be evaluated directly.")
override fun copy() = LessEqual(this.left, this.right)
override fun copy() = Match(this.left, this.right)
override fun toString(): String = "$left MATCH $right"
override fun digest(): Digest = this.hashCode().toLong()
}
Expand Down

0 comments on commit aa67213

Please sign in to comment.