fix: quantified subroutine subtyping bugs

This commit is contained in:
Shunsuke Shibayama 2023-02-22 02:40:51 +09:00
parent 4dcca2b06d
commit aa2cea60dd
28 changed files with 638 additions and 222 deletions

View file

@ -478,31 +478,24 @@ impl<Checker: BuildRunnable> Server<Checker> {
}
pub(crate) fn get_index(&self) -> &SharedModuleIndex {
self.modules
.values()
.next()
.unwrap()
.context
.index()
.unwrap()
self.modules.values().next().unwrap().context.index()
}
pub(crate) fn get_shared(&self) -> Option<&SharedCompilerResource> {
self.modules
.values()
.next()
.and_then(|module| module.context.shared())
.map(|module| module.context.shared())
}
pub(crate) fn clear_cache(&mut self, uri: &Url) {
self.artifacts.remove(uri);
if let Some(module) = self.modules.remove(uri) {
if let Some(shared) = module.context.shared() {
let path = util::uri_to_path(uri);
shared.mod_cache.remove(&path);
shared.index.remove_path(&path);
shared.graph.initialize();
}
let shared = module.context.shared();
let path = util::uri_to_path(uri);
shared.mod_cache.remove(&path);
shared.index.remove_path(&path);
shared.graph.initialize();
}
}
}