Verify that all builtin types are exposed

This commit is contained in:
Richard Feldman 2022-12-29 20:48:55 -05:00
parent 8e2eb2b28d
commit 1d2b095814
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -964,6 +964,14 @@ macro_rules! define_builtins {
$(
$(
$(
// All types should be exposed, and all non-types
// should not be exposed. (Types are uppercase.)
//
// We only check this in debug builds so that in
// release builds, this condition is either `if true`
// or `if false` and will get optimized out.
debug_assert_eq!($exposed_apply_type, $ident_name.chars().next().unwrap().is_uppercase());
if $exposed_apply_type {
scope.insert($ident_name.into(), (Symbol::new(ModuleId::$module_const, IdentId($ident_id)), Region::zero()));
}