Skip to content

Commit 6b6c7cc

Browse files
committed
fix(AsyncResult): reject unrelated Equal values in equality
1 parent 383d235 commit 6b6c7cc

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"effect": patch
3+
---
4+
5+
Fix `AsyncResult` equality treating unrelated `Equal` values with a matching tag and hash as equal.

‎packages/effect/src/reactivity/AsyncResult.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ const ResultProto = {
127127
pipe() {
128128
return pipeArguments(this, arguments)
129129
},
130-
[Equal.symbol](this: AsyncResult<any, any>, that: AsyncResult<any, any>): boolean {
131-
if (this._tag !== that._tag || this.waiting !== that.waiting) {
130+
[Equal.symbol](this: AsyncResult<any, any>, that: Equal.Equal): boolean {
131+
if (!isAsyncResult(that) || this._tag !== that._tag || this.waiting !== that.waiting) {
132132
return false
133133
}
134134
switch (this._tag) {

0 commit comments

Comments
 (0)