Re:TypeScript: Branded Types
by mason55 on Wednesday April 24, 2024 @04:09PM
(#40148958)
The decision between structural and nominal typing has nothing to do with whether you retain type information at runtime.
TS could have just as easily chosen nominal typing + a simple way to do typedefs and had everything else work like it does now. But structural typing gives you a lot of other useful features.
TS could have just as easily chosen nominal typing + a simple way to do typedefs and had everything else work like it does now. But structural typing gives you a lot of other useful features.