> As far as I know, the only viable way to do that is to make the array > intrinsically typed, which means that types are validated when elements are > inserted into the array, not when it is passed across a function boundary. > In other words, array generics. >
What if we left the array type alone, and instead focussed on "list<Foo>" type and "dict<string, Foo>", "dict<int, Bar>" types? That would allow a clear break from previous behaviour, and would allow you to introduce other changes (e.g. removing string -> int coercion for numeric string keys).