4 ms·
This is more about nominal VS structural typing. I don't see how named parameters or namespacing would prevent accidental structural type matches.
by demurgos 2y ago
This is more about nominal VS structural typing. I don't see how named parameters or namespacing would prevent accidental structural type matches.
- culi 2y agoTypeScript is a structurally typed language on purpose. But even then nominal features already exist that would have solved this problem much more elegantly. Such as `unique symbol` https://www.typescriptlang.org/docs/handbook/symbols.html#unique-symbol https://www.typescriptlang.org/docs/handbook/symbols.html#un...
- mattstir 2y agoDid you... read the article?