Earlier quoted context omitted.
> I’d kill for union types as well. > … and pattern matching. Maybe just some extensions for `switch`. Go has type switches which are… ok. If it were possible to “close up” interfaces and type switches took that in account (match completeness) you’d be done about done, you would not have the structural / patterned unpacking but that’s probably less of a concern.
the fact that the set of types that can satisfy an interface is open is the source of their power. "closed interfaces" are broadly an antipattern in Go.
That is complete nonsense.
The ability to create an open set of types is powerful, so is the ability to create a closed set of types, and they are not exclusive.
But go currently has only one of the two, which significantly limits its expressivity and type safety.