Add (possibly temporary) assertion on record access in codegen

This commit is contained in:
KtorZ 2024-04-18 16:03:02 +02:00 committed by Kasey
parent 3dd94983bd
commit 92a1da69d9
1 changed files with 5 additions and 0 deletions

View File

@ -647,6 +647,11 @@ impl<'a> CodeGenerator<'a> {
record, record,
.. ..
} => { } => {
assert!(
!record.tipo().is_pair(),
"illegal record access on a Pair. This should have been a tuple-index access."
);
if check_replaceable_opaque_type(&record.tipo(), &self.data_types) { if check_replaceable_opaque_type(&record.tipo(), &self.data_types) {
self.build(record, module_build_name, &[]) self.build(record, module_build_name, &[])
} else { } else {