Skip to content

Commit

Permalink
fix: user type renaming bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Sep 6, 2023
1 parent 2e0ee93 commit 6ca5e07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/erg_compiler/context/inquire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ impl Context {
))
}

fn validate_visibility(
pub(crate) fn validate_visibility(
&self,
ident: &Identifier,
vi: &VarInfo,
Expand Down
6 changes: 6 additions & 0 deletions crates/erg_compiler/context/instantiate_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,18 @@ impl Context {
}
}
if let Some((typ, _)) = self.get_type_and_ctx(ident.inspect()) {
if let Some((_, vi)) = self.get_var_info(ident.inspect()) {
self.inc_ref(ident.inspect(), vi, ident, self);
}
Ok(typ.clone())
} else if let Some(typ) = self
.consts
.get(ident.inspect())
.and_then(|v| self.convert_value_into_type(v.clone()).ok())
{
if let Some((_, vi)) = self.get_var_info(ident.inspect()) {
self.inc_ref(ident.inspect(), vi, ident, self);
}
Ok(typ)
} else if not_found_is_qvar {
let tyvar = named_free_var(Str::rc(other), self.level, Constraint::Uninited);
Expand Down

0 comments on commit 6ca5e07

Please sign in to comment.