Vain attempt at narrowing the type of if condition