3 ms·
> (In Rust, it would be drastically more complex, verging on impossible to pull off with a good UX, due to various language features including wildcard impls, t
by pcwalton 10y ago
> (In Rust, it would be drastically more complex, verging on impossible to pull off with a good UX, due to various language features including wildcard impls, type-parameterized traits, and a Turing-complete type system.)
Swift can downcast, and it has generic extensions and generic protocols. I highly suspect it has a Turing-complete type system as well.
Supporting this requires heroic effort in the compiler, but it can be done.