mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 10:23:20 +00:00
chore: change logical operations order
This commit is contained in:
parent
57559b6b9f
commit
7cd895a30e
5 changed files with 12 additions and 13 deletions
|
@ -2626,7 +2626,7 @@ impl Context {
|
|||
);
|
||||
log!(info "Substituted:\ninstance: {instance}");
|
||||
debug_assert!(
|
||||
self.subtype_of(&instance, &Type::Type) || instance.has_no_qvar(),
|
||||
instance.has_no_qvar() || self.subtype_of(&instance, &Type::Type),
|
||||
"{instance} has qvar (obj: {obj}, attr: {}",
|
||||
fmt_option!(attr_name)
|
||||
);
|
||||
|
@ -4072,7 +4072,7 @@ impl Context {
|
|||
pub(crate) fn recover_typarams(&self, base: &Type, guard: &GuardType) -> TyCheckResult<Type> {
|
||||
let intersec = self.intersection(&guard.to, base);
|
||||
let is_never =
|
||||
self.subtype_of(&intersec, &Type::Never) && guard.to.as_ref() != &Type::Never;
|
||||
guard.to.as_ref() != &Type::Never && self.subtype_of(&intersec, &Type::Never);
|
||||
if !is_never {
|
||||
return Ok(intersec);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue