mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat: add Sealed
trait
This commit is contained in:
parent
86cfe8f81a
commit
1c699cc2f3
14 changed files with 101 additions and 24 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue