|
|
|
|
|
by ufo
3667 days ago
|
|
The real issue is not nominal vs structural typing. Its the subsumption rule (which says that you can freely use a subtype anywhere a supertype would be expected). Mixing subtyping with subsumption and parametric polymorphism (type parameters) is really very difficult though. From a theoretic point of view, type inference and type checking are harder. From an usability perspective, the programmer now has to deal with variance annotations (for example, in Java `class List[+T]` means the T parameter is covariant) and bounded polymorphism (for example, things like <? extends T> in Java). |
|