mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
fix: const record member definition
This commit is contained in:
parent
e51e7a2003
commit
653993f637
10 changed files with 66 additions and 31 deletions
|
@ -550,8 +550,14 @@ impl Context {
|
|||
return Ok(t);
|
||||
}
|
||||
}
|
||||
if let Some((typ, _)) = self.get_type(ident.inspect()) {
|
||||
if let Some((typ, _)) = self.get_type_and_ctx(ident.inspect()) {
|
||||
Ok(typ.clone())
|
||||
} else if let Some(typ) = self
|
||||
.consts
|
||||
.get(ident.inspect())
|
||||
.and_then(|v| self.convert_value_into_type(v.clone()).ok())
|
||||
{
|
||||
Ok(typ)
|
||||
} else if not_found_is_qvar {
|
||||
let tyvar = named_free_var(Str::rc(other), self.level, Constraint::Uninited);
|
||||
tmp_tv_cache.push_or_init_tyvar(&ident.name, &tyvar, self);
|
||||
|
@ -715,7 +721,7 @@ impl Context {
|
|||
Ok(Type::NamedTuple(ts))
|
||||
}
|
||||
other => {
|
||||
let Some((typ, ctx)) = self.get_type(&Str::rc(other)) else {
|
||||
let Some((typ, ctx)) = self.get_type_and_ctx(&Str::rc(other)) else {
|
||||
return Err(TyCheckErrors::from(TyCheckError::no_type_error(
|
||||
self.cfg.input.clone(),
|
||||
line!() as usize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue