Turn runtime checks into compile-time ones