mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
fix: record type subtyping
This commit is contained in:
parent
95595ef67c
commit
6ce41ef8bd
5 changed files with 19 additions and 3 deletions
|
@ -550,15 +550,14 @@ impl Context {
|
|||
return Ok(t);
|
||||
}
|
||||
}
|
||||
if let Some(decl_t) = opt_decl_t {
|
||||
return Ok(decl_t.typ().clone());
|
||||
}
|
||||
if let Some((typ, _)) = self.get_type(ident.inspect()) {
|
||||
Ok(typ.clone())
|
||||
} 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);
|
||||
Ok(tyvar)
|
||||
} else if let Some(decl_t) = opt_decl_t {
|
||||
Ok(decl_t.typ().clone())
|
||||
} else {
|
||||
Err(TyCheckErrors::from(TyCheckError::no_type_error(
|
||||
self.cfg.input.clone(),
|
||||
|
@ -1375,6 +1374,7 @@ impl Context {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: opt_decl_t must be disassembled for each polymorphic type
|
||||
pub(crate) fn instantiate_typespec_full(
|
||||
&self,
|
||||
t_spec: &TypeSpec,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue