He’s partially correct. Smartcast will not work on out-of-scope (e.g. global) vars as they can be changed between the initial
b != null
check and the access. If it’s a scoped var it won’t have the possibility of being changed between the null check and access therefore the Smartcast will work