remove alias

This commit is contained in:
Eli Dowling 2024-02-13 15:27:44 +10:00 committed by faldor20
parent 7a09a31a6a
commit cc4453b301
No known key found for this signature in database
GPG Key ID: F2216079B890CD57
4 changed files with 3 additions and 17 deletions

View File

@ -41,9 +41,8 @@ impl<'a> Formattable for Pattern<'a> {
fn is_multiline(&self) -> bool {
// Theory: a pattern should only be multiline when it contains a comment
match self {
Pattern::SpaceBefore(_, spaces) | Pattern::SpaceAfter(_, spaces) => {
//TODO: This isn't always true, should it be?
// debug_assert!(!spaces.is_empty());
Pattern::SpaceBefore(a, spaces) | Pattern::SpaceAfter(a, spaces) => {
debug_assert!(!spaces.is_empty(), "spaces is empty in pattern {:#?}", a);
spaces.iter().any(|s| s.is_comment())
}

View File

@ -2745,7 +2745,6 @@ fn update<'a>(
state.module_cache.checked.insert(
module_id,
CheckedModule {
aliases: solved_module.aliases,
solved_subs,
decls,
abilities_store,

View File

@ -136,10 +136,6 @@ pub struct TypeCheckedModule<'a> {
#[derive(Debug)]
pub struct CheckedModule {
/// all aliases and their definitions. this has to include non-exposed aliases
/// because exposed aliases can depend on non-exposed ones)
pub aliases: MutMap<Symbol, (bool, Alias)>,
pub solved_subs: Solved<Subs>,
pub decls: Declarations,
pub abilities_store: AbilitiesStore,

View File

@ -15,10 +15,7 @@ use roc_packaging::cache::{self, RocCacheDir};
use roc_region::all::LineInfo;
use roc_reporting::report::RocDocAllocator;
use roc_solve_problem::TypeError;
use roc_types::{
subs::{Subs, Variable},
types::Alias,
};
use roc_types::subs::{Subs, Variable};
use tower_lsp::lsp_types::{Diagnostic, SemanticTokenType, Url};
@ -48,7 +45,6 @@ pub(super) struct AnalyzedModule {
exposed_imports: Vec<(Symbol, Variable)>,
///This modules imports grouped by which module they come from
imports: HashMap<ModuleId, Arc<Vec<(Symbol, Variable)>>>,
_aliases: MutMap<Symbol, (bool, Alias)>,
module_id: ModuleId,
interns: Interns,
subs: Subs,
@ -261,7 +257,6 @@ impl<'a> AnalyzedDocumentBuilder<'a> {
let subs;
let abilities;
let declarations;
let aliases;
//lookup the type info for each import from the module where it was exposed
let imports = self
@ -286,19 +281,16 @@ impl<'a> AnalyzedDocumentBuilder<'a> {
subs = m.solved_subs.into_inner();
abilities = m.abilities_store;
declarations = m.decls;
aliases = m.aliases;
} else {
let rm = self.root_module.take().unwrap();
subs = rm.subs;
abilities = rm.abilities_store;
declarations = self.declarations_by_id.remove(&module_id).unwrap();
aliases = HashMap::default();
}
let analyzed_module = AnalyzedModule {
exposed_imports,
imports,
_aliases: aliases,
subs,
abilities,
declarations,