feat: add Sealed trait

This commit is contained in:
Shunsuke Shibayama 2024-04-27 13:52:15 +09:00
parent 86cfe8f81a
commit 1c699cc2f3
14 changed files with 101 additions and 24 deletions

View file

@ -560,7 +560,12 @@ impl Context {
(Guard(lhs), Guard(rhs)) => {
lhs.target == rhs.target && self.supertype_of(&lhs.to, &rhs.to)
}
(Mono(n), NamedTuple(_)) => &n[..] == "GenericNamedTuple" || &n[..] == "GenericTuple",
(Mono(n), NamedTuple(_)) => {
&n[..] == "Tuple"
|| &n[..] == "GenericNamedTuple"
|| &n[..] == "HomogenousTuple"
|| &n[..] == "GenericTuple"
}
(Mono(n), Record(_)) => &n[..] == "Record",
(ty @ (Type | ClassType | TraitType), Record(rec)) => {
for (_, t) in rec.iter() {