upvote
If you mean type aliases, that's a good idea within a single codebase, but the distinction between different types of strings doesn't survive serialization so it wouldn't have prevented this error. What they need is a way to signal errors out-of-band, like Result<T> or exceptions.
reply
In python there's:

    VectorAlias = list[float]
    MyVectorType = typing.NewType("Vector", list[float])
The former is syntactic sugar. I was thinking of the latter, which will cause type check errors if you try to assign one list of floats to the other and they have different declared types.
reply