LightAndLight / ipso

A functional scripting language.
https://ipso.dev
17 stars 1 forks source link

Record pattern matching returns incorrect result #300

Closed LightAndLight closed 1 year ago

LightAndLight commented 1 year ago

Program:

f : { x : String, y : String, z : String } -> String
f record =
  "${record.x} ${record.y} ${record.z}"

g : { x : String, y : String, z : String } -> String
g record =
  case record of
    { x, y, z } -> "$x $y $z"

main : IO ()
main =
  comp
    println <| f { x = "1", y = "2", z = "3" }
    println <| g { x = "1", y = "2", z = "3" }

Expected output:

1 2 3
1 2 3

Actual output:

1 2 3
1 1 1