nac3core: add assertion message in TopLevelComposer::new #406

Merged
sb10q merged 1 commits from improve_nac3core_assert into master 2024-06-05 15:30:03 +08:00
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ impl TopLevelComposer {
builtin_id.insert(name, DefinitionId(id));
} else if let TopLevelDef::Class { name, constructor, object_id, .. } = &*def
{
assert_eq!(id, object_id.0);
assert_eq!(id, object_id.0, "Object id of class '{}' should match its index in builtin name list", name);
if let Some(constructor) = constructor {
builtin_ty.insert(*name, *constructor);
}