Ref sugar (take 2) is not applied when casting in TypeScript
Version
3.2.0-beta.7
Reproduction link
Steps to reproduce
After opening the reproduction link, follow the instructions in the screen, and check the console.
What is expected?
Variables should be desugared even when being typecasted or asserted as non-null. Type casting should not affect runtime behavior.
What is actually happening?
Some usages are not being desugared by the compiler when casting explicitly or using the Non-Null Assertion Operator in TypeScript.