mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
fix: array type bug
This commit is contained in:
parent
b5f5876631
commit
cf726fe4a8
4 changed files with 19 additions and 2 deletions
|
@ -413,7 +413,14 @@ impl<A: ASTBuildable> GenericASTLowerer<A> {
|
|||
{
|
||||
return Err(self.elem_err(&l, &r, elem));
|
||||
} // else(OK): e.g. [1, "a": Str or Int]
|
||||
} else {
|
||||
}
|
||||
// OK: ?T(:> {"a"}) or ?U(:> {"b"}) or {"c", "d"} => {"a", "b", "c", "d"} <: Str
|
||||
else if self
|
||||
.module
|
||||
.context
|
||||
.coerce(union_.clone(), &())
|
||||
.map_or(true, |coerced| coerced.union_pair().is_some())
|
||||
{
|
||||
return Err(self.elem_err(&l, &r, elem));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue