Closed maurges closed 4 years ago
Well, "expected" is a bad word, since I was expecting it to fail in all cases with duplicated field names with different types. It also does fail with something like union {y: {y: "y"}} {y: "y"}
and produces garbage with union {y: {y: "y"}} {y: 5}
I don't think this is a bug in union
per se. This bug happens because the Show
implementation for records uses unsafeGet
indiscriminately from a RowList
, and does not consider whether there are duplicates.
That seems accurate to me. Shall we move this to prelude
then?
Using
"purescript": "^0.13.6"
and package setpsc-0.13.6-20200423
Here's my foot gun:
Causes
TypeError: s.replace is not a function
after logging2
.Changing to
let x = union {y: "5"} {y: 5}
gets rid of error and produces expected representation:{ y: "5", y: 5 }