|
|
|
|
|
by eyelidlessness
1233 days ago
|
|
That is (was) a good thing! It’s basically the `as any` of strict null checks, and just as unsafe. Now that you do know about it, please use it sparingly if at all, i.e. when you’re absolutely sure you know more than the type checker, or when you’re in a context where it’ll be caught by other means. My typical lint setup disallows it in source code without an explanatory comment, and allows it in tests under the assumptions that either they’ll fail if wrong or that a reviewer will call out the test as overly complicated. |
|