Skip to content

Commit

Permalink
Update classes.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Aug 13, 2024
1 parent b21d018 commit b75325d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions crates/erg_compiler/context/initialize/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2249,12 +2249,21 @@ impl Context {
ValueObj::builtin_class(dict_keys_iterator),
);
dict_.register_trait_methods(dict_t.clone(), dict_iterable);
dict_
.register_trait(
self,
poly(CONTAINER, vec![ty_tp(proj_call(D.clone(), KEYS, vec![]))]),
)
.unwrap();
let mut dict_collection = Self::builtin_methods(
Some(poly(
CONTAINER,
vec![ty_tp(proj_call(D.clone(), KEYS, vec![]))],
)),
4,
);
// TODO: Obj => D.keys() (Structural { .__contains__ = ... })
dict_collection.register_builtin_erg_impl(
FUNDAMENTAL_CONTAINS,
fn1_met(dict_t.clone(), Obj, Bool).quantify(),
Const,
Visibility::BUILTIN_PUBLIC,
);
dict_.register_trait_methods(dict_t.clone(), dict_collection);
let dict_values_t = fn0_met(
dict_t.clone(),
poly(
Expand Down

0 comments on commit b75325d

Please sign in to comment.