mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat: impl Hash for Array
This commit is contained in:
parent
53a43962e8
commit
57d3a23aed
7 changed files with 71 additions and 19 deletions
|
@ -1359,6 +1359,14 @@ impl Context {
|
|||
Immutable,
|
||||
Visibility::BUILTIN_PUBLIC,
|
||||
);
|
||||
let mut array_hash = Self::builtin_methods(Some(mono(HASH)), 1);
|
||||
array_hash.register_builtin_erg_impl(
|
||||
OP_HASH,
|
||||
fn0_met(mono(GENERIC_ARRAY), Int),
|
||||
Const,
|
||||
Visibility::BUILTIN_PUBLIC,
|
||||
);
|
||||
generic_array.register_trait(mono(GENERIC_ARRAY), array_hash);
|
||||
/* Array */
|
||||
let mut array_ =
|
||||
Self::builtin_poly_class(ARRAY, vec![PS::t_nd(TY_T), PS::default(TY_N, Nat)], 10);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue