diff --git a/crates/aiken-lang/src/tipo.rs b/crates/aiken-lang/src/tipo.rs index 68040384..f29257c3 100644 --- a/crates/aiken-lang/src/tipo.rs +++ b/crates/aiken-lang/src/tipo.rs @@ -819,9 +819,12 @@ pub fn find_and_replace_generics( mono_types: &IndexMap>, ) -> Rc { if let Some(id) = tipo.get_generic() { - // If a generic does not have a type we know of - // like a None in option then just use same type - mono_types.get(&id).unwrap_or(tipo).clone() + mono_types + .get(&id) + .unwrap_or_else(|| { + panic!("Unknown generic id {id:?} for type {tipo:?} in mono_types {mono_types:#?}"); + }) + .clone() } else if tipo.is_generic() { match &**tipo { Type::App {