mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
fix: iterator bugs
This commit is contained in:
parent
ed245f6c08
commit
efcf23b04d
4 changed files with 18 additions and 2 deletions
|
@ -1761,7 +1761,10 @@ impl Context {
|
|||
let mut enumerate = Self::builtin_poly_class(ENUMERATE, vec![PS::t_nd(TY_T)], 2);
|
||||
enumerate.register_superclass(Obj, &obj);
|
||||
enumerate
|
||||
.register_marker_trait(self, poly(ITERABLE, vec![ty_tp(T.clone())]))
|
||||
.register_marker_trait(
|
||||
self,
|
||||
poly(ITERABLE, vec![ty_tp(tuple_t(vec![Nat, T.clone()]))]),
|
||||
)
|
||||
.unwrap();
|
||||
enumerate
|
||||
.register_marker_trait(self, poly(OUTPUT, vec![ty_tp(T.clone())]))
|
||||
|
|
|
@ -77,7 +77,7 @@ impl Context {
|
|||
.quantify();
|
||||
let t_filter = nd_func(
|
||||
vec![
|
||||
kw(KW_FUNC, nd_func(vec![anon(T.clone())], None, T.clone())),
|
||||
kw(KW_FUNC, nd_func(vec![anon(T.clone())], None, Bool)),
|
||||
kw(KW_ITERABLE, poly(ITERABLE, vec![ty_tp(T.clone())])),
|
||||
],
|
||||
None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue