change runtime warning to compile time warning