mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
feat: polymorphic type class members
This commit is contained in:
parent
f65e3acaf3
commit
e3b479ebf7
12 changed files with 247 additions and 48 deletions
|
@ -1181,7 +1181,7 @@ impl Context {
|
|||
);
|
||||
/* Array */
|
||||
let mut array_ =
|
||||
Self::builtin_poly_class(ARRAY, vec![PS::t_nd(TY_T), PS::named_nd(TY_N, Nat)], 10);
|
||||
Self::builtin_poly_class(ARRAY, vec![PS::t_nd(TY_T), PS::default(TY_N, Nat)], 10);
|
||||
array_.register_superclass(mono(GENERIC_ARRAY), &generic_array);
|
||||
array_
|
||||
.register_marker_trait(self, poly(OUTPUT, vec![ty_tp(T.clone())]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue