Better HN
topnewbestaskshowjobs
Log inSign up

lacyleathers

1 karma · joined Jun 15, 2022 (4y ago) · 2 submissions

Submissions

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

>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.