Added test for #1255: Compiler NPE on invalid statement

Test passes now that typechecker sees the error