-
Notifications
You must be signed in to change notification settings - Fork 469
Description
This was discussed on the discord chat.
Recently, it was discovered that Js.Array.push
leads to unsoundness when combined with polymorphic empty arrays ([||]
has type 'a array
in OCaml). The issue was reported in #4087 and was promptly fixed in #4090 which made empty arrays weakly polymorphic. It restored soundness but broke some existing code relying on the previous behavior (see Risto-Stevcev/bastet#20).
While there are discussions on how to approach the breakage, I suggest adding a compilation flag making existing code compilable within the BS 7.x series. Something like -bs-unsafe-empty-array
. In fact, it was suggested by @bobzhang; I'm just filing an issue so it won't get lost.
I want to add there are different opinions on whether it's a good precedent to diverge from the native behavior but at least having a compilation flag will unblock me personally and I'm pretty sure a few other people too.