feat: fix up generic type functions to work with the new air tree functions

chore: remove commented code
This commit is contained in:
microproofs
2023-07-10 16:11:45 -04:00
committed by Kasey
parent b3714ca9d0
commit fd83c9a739
3 changed files with 207 additions and 33 deletions

View File

@@ -2010,12 +2010,18 @@ pub fn special_case_builtin(
pub fn get_arg_type_name(tipo: &Type) -> String {
match tipo {
Type::App { name, .. } => name.clone(),
Type::App { name, args, .. } => {
let inner_args = args.iter().map(|arg| get_arg_type_name(arg)).collect_vec();
format!("{}_{}", name, inner_args.join("_"))
}
Type::Var { tipo } => match tipo.borrow().clone() {
TypeVar::Link { tipo } => get_arg_type_name(tipo.as_ref()),
_ => unreachable!(),
},
Type::Tuple { .. } => "".to_string(),
Type::Tuple { elems } => {
let inner_args = elems.iter().map(|arg| get_arg_type_name(arg)).collect_vec();
inner_args.join("_")
}
_ => unreachable!(),
}
}