fix: subtype relation bug

This commit is contained in:
Shunsuke Shibayama 2024-02-03 19:36:27 +09:00
parent 8d5641503f
commit 9c9f8b7a0a
7 changed files with 233 additions and 121 deletions

View file

@ -329,7 +329,11 @@ impl Context {
if !self.is_trait(lhs) {
return (Maybe, false);
}
self._nominal_subtype_of(lhs, rhs, |ty_ctx| &ty_ctx.super_traits)
let (cred, judge) = self._nominal_subtype_of(lhs, rhs, |ty_ctx| &ty_ctx.super_traits[..]);
if judge {
return (cred, judge);
}
self._nominal_subtype_of(lhs, rhs, |ty_ctx| &ty_ctx.super_classes[..])
}
/// lhs :> rhs?