mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
chore: add record examples
This commit is contained in:
parent
5e71bd7fd0
commit
a0ce142f7b
4 changed files with 25 additions and 5 deletions
|
@ -1788,6 +1788,13 @@ impl Context {
|
|||
Ok(array_t(union, len))
|
||||
}
|
||||
ValueObj::Set(set) => Ok(v_enum(set)),
|
||||
ValueObj::Dict(dic) => {
|
||||
let dic = dic
|
||||
.into_iter()
|
||||
.map(|(k, v)| (TyParam::Value(k), TyParam::Value(v)))
|
||||
.collect();
|
||||
Ok(dict_t(TyParam::Dict(dic)))
|
||||
}
|
||||
ValueObj::Subr(subr) => subr.as_type(self).ok_or(ValueObj::Subr(subr)),
|
||||
other => Err(other),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue