|
|
|
|
|
by williamdclt
473 days ago
|
|
I don’t agree it’s a structural VS nominal difference. Typescript is structural, but it does have the “implements” keyword. Which makes a million times more sense to me, because realistically when do you ever have a structure that usefully implements an interface without being aware of it?? The common use-case is to implement an existing interface (in which case might as well enforce adherence to the interface at declaration point), not to plug an implementation into an unrelated functionality that happens to expect the right interface. |
|
If "Two" didn't have a "name: string" member, then the error would be on the call to "test".