Design patterns·Objects, messages and the principles
the object had every method the interface asked for and the compiler still refused it, because it had not said it implemented it.
Nominal vs structural typing
Also callednominal typing, structural typing, name-based vs shape-based typing
Nominal typing decides compatibility by the declared name — a type fits only if it says it does; structural typing decides by shape — a type fits if it has the right members. It explains why the same code is accepted by one language and rejected by another, and why interfaces feel heavier in some ecosystems than others. Structural typing makes test doubles and adapters nearly free; nominal typing makes the intent explicit and catches accidental compatibility.