4 ms·
Thats not 100% true in TypeScript. TypeScript actually only allows "up-casts" and "down-cast" (but if the type is neither a supertype nor a subtype the compiler
by alexcole 7y ago
Thats not 100% true in TypeScript. TypeScript actually only allows "up-casts" and "down-cast" (but if the type is neither a supertype nor a subtype the compiler will throw an error).
- nojvek 7y agoThat’s my understanding too. You just can’t cast types wily Nily.
- seanmcdirmid 7y agoYa, I often have to write “this as any as T” because I’m using T as a self type.