The wire format reads and writes exactly N elements for values of this
type; the codec throws on any other length. The array is readonly because
the exact length is part of the type: push, pop, and splice would
leave the runtime length disagreeing with it.
N is a literal type, so a dynamically built array is inferred as T[]
(length number) and is not assignable here. Use fixedArray to
build one — it checks the length at runtime, so no cast is needed. An
as const tuple of the right length is also assignable.
An array that must contain exactly
Nelements.The wire format reads and writes exactly
Nelements for values of this type; the codec throws on any other length. The array is readonly because the exact length is part of the type:push,pop, andsplicewould leave the runtime length disagreeing with it.Nis a literal type, so a dynamically built array is inferred asT[](lengthnumber) and is not assignable here. Use fixedArray to build one — it checks the length at runtime, so no cast is needed. Anas consttuple of the right length is also assignable.