No, the syntax is correct, otherwise the compiler would have complained. It's the semantics that are wrong.