Merge remote-tracking branch 'origin/trunk' into pretty-expect-output

This commit is contained in:
Folkert 2022-07-15 09:12:04 +02:00
commit b9ebd4fa27
76 changed files with 2719 additions and 817 deletions

View file

@ -359,9 +359,6 @@ impl IAbilitiesStore<Resolved> {
}
pub fn insert_resolved(&mut self, id: SpecializationId, specialization: Symbol) {
// May not be a thing in mono
// debug_assert!(self.is_specialization_name(specialization));
let old_specialization = self.resolved_specializations.insert(id, specialization);
debug_assert!(
@ -371,15 +368,6 @@ impl IAbilitiesStore<Resolved> {
);
}
pub fn remove_resolved(&mut self, id: SpecializationId) {
let old_specialization = self.resolved_specializations.remove(&id);
debug_assert!(
old_specialization.is_some(),
"Trying to remove a resolved specialization that was never there!",
);
}
pub fn get_resolved(&self, id: SpecializationId) -> Option<Symbol> {
self.resolved_specializations.get(&id).copied()
}

File diff suppressed because it is too large Load diff

View file

@ -472,6 +472,15 @@ pub enum Recursive {
TailRecursive = 2,
}
impl Recursive {
pub fn is_recursive(&self) -> bool {
match self {
Recursive::NotRecursive => false,
Recursive::Recursive | Recursive::TailRecursive => true,
}
}
}
#[derive(Clone, Debug)]
pub struct WhenBranch {
pub patterns: Vec<Loc<Pattern>>,

View file

@ -5,6 +5,7 @@ pub mod abilities;
pub mod annotation;
pub mod builtins;
pub mod constraint;
pub mod copy;
pub mod def;
pub mod effect_module;
pub mod env;

View file

@ -56,6 +56,13 @@ impl Scope {
self.lookup_str(ident.as_str(), region)
}
pub fn add_docs_imports(&mut self) {
self.imports
.push(("Dict".into(), Symbol::DICT_DICT, Region::zero()));
self.imports
.push(("Set".into(), Symbol::SET_SET, Region::zero()));
}
pub fn lookup_str(&self, ident: &str, region: Region) -> Result<Symbol, RuntimeError> {
use ContainsIdent::*;
@ -653,8 +660,6 @@ mod test {
Ident::from("List"),
Ident::from("Ok"),
Ident::from("Err"),
// Ident::from("Dict"),
// Ident::from("Set"),
Ident::from("Box"),
]
);
@ -680,8 +685,6 @@ mod test {
Ident::from("List"),
Ident::from("Ok"),
Ident::from("Err"),
// Ident::from("Dict"),
// Ident::from("Set"),
Ident::from("Box"),
]
);