Make codegen usage safer