|
|
|
|
|
by lolinder
398 days ago
|
|
TypeScript supports runtime type assertions, but it doesn't mandate them or write them for you. I should have said your type system cannot be sound without runtime overhead. And I don't believe that choosing automatic runtime overhead is the right move. |
|
TypeScript desperately needs a way to derive type-guarding functions from types (and so does every gradually-typed language). There're libraries for this but you need to define the types themselves through combinators.