mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
remove alias
This commit is contained in:
parent
3561d66f62
commit
6d3fd89f8e
4 changed files with 3 additions and 17 deletions
|
@ -41,9 +41,8 @@ impl<'a> Formattable for Pattern<'a> {
|
||||||
fn is_multiline(&self) -> bool {
|
fn is_multiline(&self) -> bool {
|
||||||
// Theory: a pattern should only be multiline when it contains a comment
|
// Theory: a pattern should only be multiline when it contains a comment
|
||||||
match self {
|
match self {
|
||||||
Pattern::SpaceBefore(_, spaces) | Pattern::SpaceAfter(_, spaces) => {
|
Pattern::SpaceBefore(a, spaces) | Pattern::SpaceAfter(a, spaces) => {
|
||||||
//TODO: This isn't always true, should it be?
|
debug_assert!(!spaces.is_empty(), "spaces is empty in pattern {:#?}", a);
|
||||||
// debug_assert!(!spaces.is_empty());
|
|
||||||
|
|
||||||
spaces.iter().any(|s| s.is_comment())
|
spaces.iter().any(|s| s.is_comment())
|
||||||
}
|
}
|
||||||
|
|
|
@ -2745,7 +2745,6 @@ fn update<'a>(
|
||||||
state.module_cache.checked.insert(
|
state.module_cache.checked.insert(
|
||||||
module_id,
|
module_id,
|
||||||
CheckedModule {
|
CheckedModule {
|
||||||
aliases: solved_module.aliases,
|
|
||||||
solved_subs,
|
solved_subs,
|
||||||
decls,
|
decls,
|
||||||
abilities_store,
|
abilities_store,
|
||||||
|
|
|
@ -136,10 +136,6 @@ pub struct TypeCheckedModule<'a> {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct CheckedModule {
|
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 solved_subs: Solved<Subs>,
|
||||||
pub decls: Declarations,
|
pub decls: Declarations,
|
||||||
pub abilities_store: AbilitiesStore,
|
pub abilities_store: AbilitiesStore,
|
||||||
|
|
|
@ -15,10 +15,7 @@ use roc_packaging::cache::{self, RocCacheDir};
|
||||||
use roc_region::all::LineInfo;
|
use roc_region::all::LineInfo;
|
||||||
use roc_reporting::report::RocDocAllocator;
|
use roc_reporting::report::RocDocAllocator;
|
||||||
use roc_solve_problem::TypeError;
|
use roc_solve_problem::TypeError;
|
||||||
use roc_types::{
|
use roc_types::subs::{Subs, Variable};
|
||||||
subs::{Subs, Variable},
|
|
||||||
types::Alias,
|
|
||||||
};
|
|
||||||
|
|
||||||
use tower_lsp::lsp_types::{Diagnostic, SemanticTokenType, Url};
|
use tower_lsp::lsp_types::{Diagnostic, SemanticTokenType, Url};
|
||||||
|
|
||||||
|
@ -48,7 +45,6 @@ pub(super) struct AnalyzedModule {
|
||||||
exposed_imports: Vec<(Symbol, Variable)>,
|
exposed_imports: Vec<(Symbol, Variable)>,
|
||||||
///This modules imports grouped by which module they come from
|
///This modules imports grouped by which module they come from
|
||||||
imports: HashMap<ModuleId, Arc<Vec<(Symbol, Variable)>>>,
|
imports: HashMap<ModuleId, Arc<Vec<(Symbol, Variable)>>>,
|
||||||
_aliases: MutMap<Symbol, (bool, Alias)>,
|
|
||||||
module_id: ModuleId,
|
module_id: ModuleId,
|
||||||
interns: Interns,
|
interns: Interns,
|
||||||
subs: Subs,
|
subs: Subs,
|
||||||
|
@ -261,7 +257,6 @@ impl<'a> AnalyzedDocumentBuilder<'a> {
|
||||||
let subs;
|
let subs;
|
||||||
let abilities;
|
let abilities;
|
||||||
let declarations;
|
let declarations;
|
||||||
let aliases;
|
|
||||||
|
|
||||||
//lookup the type info for each import from the module where it was exposed
|
//lookup the type info for each import from the module where it was exposed
|
||||||
let imports = self
|
let imports = self
|
||||||
|
@ -286,19 +281,16 @@ impl<'a> AnalyzedDocumentBuilder<'a> {
|
||||||
subs = m.solved_subs.into_inner();
|
subs = m.solved_subs.into_inner();
|
||||||
abilities = m.abilities_store;
|
abilities = m.abilities_store;
|
||||||
declarations = m.decls;
|
declarations = m.decls;
|
||||||
aliases = m.aliases;
|
|
||||||
} else {
|
} else {
|
||||||
let rm = self.root_module.take().unwrap();
|
let rm = self.root_module.take().unwrap();
|
||||||
subs = rm.subs;
|
subs = rm.subs;
|
||||||
abilities = rm.abilities_store;
|
abilities = rm.abilities_store;
|
||||||
declarations = self.declarations_by_id.remove(&module_id).unwrap();
|
declarations = self.declarations_by_id.remove(&module_id).unwrap();
|
||||||
aliases = HashMap::default();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let analyzed_module = AnalyzedModule {
|
let analyzed_module = AnalyzedModule {
|
||||||
exposed_imports,
|
exposed_imports,
|
||||||
imports,
|
imports,
|
||||||
_aliases: aliases,
|
|
||||||
subs,
|
subs,
|
||||||
abilities,
|
abilities,
|
||||||
declarations,
|
declarations,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue