Add compile error when rewriting method