Re:Sshole
by BoppreH on Thursday November 05, 2026 @10:28AM
(#50380315)
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. They really needed to return either null or a structure that includes a tag indicating success or failure (aka Result<T>).
[ Parent
| on HN ]
Re:Sshole
by __MatrixMan__ on Thursday November 05, 2026 @10:34AM
(#50380427)
At least in python there's a difference between type aliases and typing.NewType (the difference described here: https://gist.github.com/simonwhitaker/3a24d669b26b4f373690c6...)
That's what I was thinking of. I assume something similar exists in other languages.
Re:Sshole
by __MatrixMan__ on Thursday November 05, 2026 @11:07AM
(#50380881)
In python, aliases are separate from typing.NewType, but you're right: it's only enforced within a codebase and then only if the dev cares to run the typechecker.
So yeah, I guess it either needs to happen at runtime, or we just do signaling and user data on separate file descriptors.