The TypeScript compiler automatically casts a variable to the relevant type inside conditionals where it is possible to infer the type (because ``++typeof++``, ``++instanceof++``, etc was used). This compiler feature makes casts and not-``++null++`` assertions unnecessary.