effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Structural equality on JavaScript backend doesn't work

Open jiribenes opened this issue 3 months ago • 1 comments

The structural equality on the JavaScript backend seems to be broken. Although reflexivity (x == x) holds for simple, user-defined types, it doesn't work for Some(x) == Some(x).

type MyType {
  MySingleCase()
}

record EmptyRecord()

def main() = {
  println(MySingleCase() == MySingleCase())   // ~> true
  println(EmptyRecord() == EmptyRecord())     // ~> true

  println(Some(MySingleCase()) == Some(MySingleCase())) // ~> false
  println(Some(EmptyRecord()) == Some(EmptyRecord()))   // ~> false
}

jiribenes avatar Mar 22 '24 15:03 jiribenes