mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 04:44:44 +00:00
Fix subtyping bug
This commit is contained in:
parent
978866b31a
commit
c39973f536
7 changed files with 110 additions and 19 deletions
|
@ -784,6 +784,13 @@ impl Context {
|
|||
(_, TyParam::FreeVar(fv), _) if fv.is_linked() => {
|
||||
self.supertype_of_tp(lp, &fv.crack(), variance)
|
||||
}
|
||||
// _: Type :> T == true
|
||||
(TyParam::Erased(t), TyParam::Type(_), _)
|
||||
| (TyParam::Type(_), TyParam::Erased(t), _)
|
||||
if t.as_ref() == &Type =>
|
||||
{
|
||||
true
|
||||
}
|
||||
(TyParam::Type(l), TyParam::Type(r), Variance::Contravariant) => self.subtype_of(l, r),
|
||||
(TyParam::Type(l), TyParam::Type(r), Variance::Covariant) => {
|
||||
// if matches!(r.as_ref(), &Type::Refinement(_)) { log!(info "{l}, {r}, {}", self.structural_supertype_of(l, r, bounds, Some(lhs_variance))); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue