WebAssembly / gc

Branch of the spec repo scoped to discussion of GC integration in WebAssembly
https://webassembly.github.io/gc/
Other
997 stars 72 forks source link

why covariant array? #418

Closed Guest0x0 closed 1 year ago

Guest0x0 commented 1 year ago

https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP.md#composite-types says:

Array types support depth subtyping

array <fieldtype1> <: array <fieldtype2> iff <fieldtype1> <: <fieldtype2>

But arrays are mutable in the proposal and should be invariant.

vouillon commented 1 year ago

See the next line: