If you step outside the generic interface, duck-typing would of course also give you a compiler (or runtime) error. Not sure what scenario you're imagining here.
>Mixing up a string for a list of strings, which both satisfy the iterable interface But those are actual valid and useful implementations of the interface, nominative typing wouldn't save you.
If you step outside the generic interface, duck-typing would of course also give you a compiler (or runtime) error. Not sure what scenario you're imagining here.
>Mixing up a string for a list of strings, which both satisfy the iterable interface But those are actual valid and useful implementations of the interface, nominative typing wouldn't save you.