mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
feat: type narrowing with filter
This commit is contained in:
parent
5345b07791
commit
bd39393746
9 changed files with 209 additions and 36 deletions
|
@ -1377,6 +1377,9 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
|
|||
(Structural(sub), Structural(sup)) => {
|
||||
self.sub_unify(sub, sup)?;
|
||||
}
|
||||
(Guard(sub), Guard(sup)) => {
|
||||
self.sub_unify(&sub.to, &sup.to)?;
|
||||
}
|
||||
(sub, Structural(sup)) => {
|
||||
let sub_fields = self.ctx.fields(sub);
|
||||
for (sup_field, sup_ty) in self.ctx.fields(sup) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue