mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
merge from main
This commit is contained in:
parent
6b8e7314f2
commit
8c983c3714
4 changed files with 34 additions and 124 deletions
|
@ -809,12 +809,20 @@ impl ASTLowerer {
|
|||
self.errs.extend(errs);
|
||||
VarInfo::ILLEGAL.clone()
|
||||
});
|
||||
if let (Some(guard), Some(return_t)) = (guard, vi.t.mut_return_t()) {
|
||||
debug_assert!(
|
||||
self.module.context.subtype_of(return_t, &Type::Bool),
|
||||
"{return_t} is not a subtype of Bool"
|
||||
);
|
||||
*return_t = guard;
|
||||
if let Some(guard) = guard {
|
||||
if let Some(return_t) = vi.t.mut_return_t() {
|
||||
debug_assert!(
|
||||
self.module.context.subtype_of(return_t, &Type::Bool),
|
||||
"{return_t} is not a subtype of Bool"
|
||||
);
|
||||
*return_t = guard;
|
||||
} else if let Some(mut return_t) = vi.t.tyvar_mut_return_t() {
|
||||
debug_assert!(
|
||||
self.module.context.subtype_of(&return_t, &Type::Bool),
|
||||
"{return_t} is not a subtype of Bool"
|
||||
);
|
||||
*return_t = guard;
|
||||
}
|
||||
}
|
||||
let mut args = args.into_iter();
|
||||
let lhs = args.next().unwrap().expr;
|
||||
|
@ -975,6 +983,8 @@ impl ASTLowerer {
|
|||
);
|
||||
if let Some(ret_t) = vi.t.mut_return_t() {
|
||||
*ret_t = guard;
|
||||
} else if let Some(mut ref_t) = vi.t.tyvar_mut_return_t() {
|
||||
*ref_t = guard;
|
||||
}
|
||||
}
|
||||
let attr_name = if let Some(attr_name) = call.attr_name {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue