mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-03 05:54:33 +00:00
fix: [x; _]
bug
This commit is contained in:
parent
cce95e7210
commit
24da5cdfbd
4 changed files with 30 additions and 0 deletions
|
@ -1809,6 +1809,10 @@ impl Context {
|
|||
}
|
||||
Ok(array_t(union, TyParam::value(len)))
|
||||
}
|
||||
TyParam::UnsizedArray(elem) => {
|
||||
let elem = self.convert_tp_into_type(*elem)?;
|
||||
Ok(unknown_len_array_t(elem))
|
||||
}
|
||||
TyParam::Set(tps) => {
|
||||
let mut union = Type::Never;
|
||||
for tp in tps.iter() {
|
||||
|
@ -1874,6 +1878,10 @@ impl Context {
|
|||
}
|
||||
Ok(ValueObj::Array(new.into()))
|
||||
}
|
||||
TyParam::UnsizedArray(elem) => {
|
||||
let elem = self.convert_tp_into_value(*elem)?;
|
||||
Ok(ValueObj::UnsizedArray(Box::new(elem)))
|
||||
}
|
||||
TyParam::Tuple(tys) => {
|
||||
let mut new = vec![];
|
||||
for elem in tys {
|
||||
|
@ -1978,6 +1986,13 @@ impl Context {
|
|||
}
|
||||
Ok(TyParam::Array(new_arr))
|
||||
}
|
||||
ValueObj::UnsizedArray(elem) => {
|
||||
let tp = match Self::convert_value_into_tp(*elem) {
|
||||
Ok(tp) => tp,
|
||||
Err(tp) => tp,
|
||||
};
|
||||
Ok(TyParam::UnsizedArray(Box::new(tp)))
|
||||
}
|
||||
ValueObj::Tuple(vs) => {
|
||||
let mut new_ts = vec![];
|
||||
for v in vs.iter().cloned() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue