3 ms·
That's neat, I was about to ask which languages support that since the vast majority don't. I didn't know that you can do that in Typescript.
by jonathanstrange 10mo ago
That's neat, I was about to ask which languages support that since the vast majority don't. I didn't know that you can do that in Typescript.
- Mekaniko 10mo agoAny language with an type system really... Even OOP : if you have a string class, you can have a String_Formated_For_API subtype. Just extends String, and add some checking. But now the type checker "knows" it can print() a String_Formated_For_API just fine but not call_API(string).