Allow constant arrays of constant types
!120 (merged) makes extensive changes, including how constants are defined and loaded in the VM. In its current state, constants are limited to String
, Int
, and Float
. This is mostly an artifact from before Inko had immutable types, as allowing constants would not be thread safe. Now that Inko can distinguish between immutable and mutable types, we can allows arrays of these value types. That is, a constant can also be set to an array literal of type Array[Int]
, Array[Float]
, Array[String]
, or a nested array (e.g. Array[Array[Int]]
). Allowing this makes it easier to implement certain algorithms that use lookup tables, as it removes the need for allocating these arrays every time at runtime.