mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
Update classes.rs
This commit is contained in:
parent
c8ec8a6f09
commit
9735ad4103
2 changed files with 22 additions and 0 deletions
|
@ -1831,6 +1831,22 @@ impl Context {
|
|||
ValueObj::builtin_class(out_t),
|
||||
);
|
||||
list_.register_trait_methods(lis_t.clone(), list_mul);
|
||||
let mut fallback_list_mul = Self::builtin_methods(Some(poly(MUL, vec![ty_tp(Nat)])), 2);
|
||||
let mul_t = fn1_met(lis_t.clone(), Nat, out_unknown_len_list_t(T.clone())).quantify();
|
||||
fallback_list_mul.register_builtin_erg_impl(
|
||||
OP_MUL,
|
||||
mul_t,
|
||||
Immutable,
|
||||
Visibility::BUILTIN_PUBLIC,
|
||||
);
|
||||
let out_t = out_unknown_len_list_t(T.clone());
|
||||
fallback_list_mul.register_builtin_const(
|
||||
OUTPUT,
|
||||
Visibility::BUILTIN_PUBLIC,
|
||||
None,
|
||||
ValueObj::builtin_class(out_t),
|
||||
);
|
||||
list_.register_trait_methods(lis_t.clone(), fallback_list_mul);
|
||||
// [T; N].MutType! = [T; !N] (neither [T!; N] nor [T; N]!)
|
||||
let mut_type =
|
||||
ValueObj::builtin_class(poly(MUT_LIST, vec![TyParam::t(T.clone()), N.clone()]));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue