fix: in operator

* remove `In` trait, `__in__`, `__notin__` function
* desugar to `__contains__`
* impl Collection for Array, Set, Tuple
This commit is contained in:
Shunsuke Shibayama 2023-08-13 01:01:06 +09:00
parent 4f93c393c0
commit 2e9fb48f2e
19 changed files with 154 additions and 142 deletions

View file

@ -767,9 +767,7 @@ impl<'c, 'q, 'l, L: Locational> Dereferencer<'c, 'q, 'l, L> {
};
if sub_t == super_t {
Ok(sub_t)
}
// REVIEW: Even if type constraints can be satisfied, implementation may not exist
else if is_subtype {
} else if is_subtype {
match self.variance {
// ?T(<: Sup) --> Sup (Sup != Obj), because completion will not work if Never is selected.
// ?T(:> Never, <: Obj) --> Never