just before Num

This commit is contained in:
Folkert 2022-02-26 23:11:40 +01:00
parent c0d3543d5a
commit 65b1b3fcce
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
11 changed files with 976 additions and 90 deletions

View file

@ -242,6 +242,8 @@ pub fn canonicalize_module_defs<'a>(
panic!("TODO gracefully handle shadowing in imports.")
}
}
} else if symbol == Symbol::LIST_LIST || symbol == Symbol::STR_STR {
// These are not aliases but Apply's and we make sure they are always in scope
} else {
// This is a type alias
@ -260,8 +262,11 @@ pub fn canonicalize_module_defs<'a>(
Ok(()) => {
// here we do nothing special
}
Err((_shadowed_symbol, _region)) => {
panic!("TODO gracefully handle shadowing in imports.")
Err((shadowed_symbol, _region)) => {
panic!(
"TODO gracefully handle shadowing in imports, {:?} is shadowed.",
shadowed_symbol
)
}
}
}
@ -376,7 +381,7 @@ pub fn canonicalize_module_defs<'a>(
let symbol = def.pattern_vars.iter().next().unwrap().0;
match crate::builtins::builtin_defs_map(*symbol, var_store) {
None => {
panic!("A builtin module contains a signature without implementation")
panic!("A builtin module contains a signature without implementation for {:?}", symbol)
}
Some(mut replacement_def) => {
replacement_def.annotation = def.annotation.take();