mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
fix: user type renaming bug
This commit is contained in:
parent
2e0ee937fc
commit
6ca5e07191
2 changed files with 7 additions and 1 deletions
|
@ -1329,7 +1329,7 @@ impl Context {
|
|||
))
|
||||
}
|
||||
|
||||
fn validate_visibility(
|
||||
pub(crate) fn validate_visibility(
|
||||
&self,
|
||||
ident: &Identifier,
|
||||
vi: &VarInfo,
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue