It's a semantic error. If it were a syntax error the code would not compile.