3 ms·
TypeScript cannot be sound because its model of the runtime environment necessarily diverges from the runtime truth. A simple example: some properties were remo
by ridiculous_fish 9y ago
TypeScript cannot be sound because its model of the runtime environment necessarily diverges from the runtime truth. A simple example: some properties were removed in ES6, so type checking against an ES5 runtime will result in type errors when run in an ES6 browser, and vice versa.
Soundness only provides a guarantee if you control when and how your code will be executed, and that's a tough constraint. To prove is not to forsee the future.
- johnny_reilly 9y ago> some properties were removed in ES6 Which properties are you referring to? My understanding is that ES6 is back compatible and so that can't be case. There's "use strict" but that's a different kettle of fish; a pragma that changes runtime behaviour..
- O4epegb 9y agoBut you must specify for what target you compiling and typecheking for.