type checker: remove dead code