fix: bytes type definition

This commit is contained in:
Shunsuke Shibayama 2023-10-18 15:07:36 +09:00
parent 5096843bc5
commit d0bae66450

View file

@ -51,11 +51,17 @@ impl Context {
NoneType, NoneType,
); );
let t_bin = nd_func(vec![kw(KW_N, Int)], None, Str); let t_bin = nd_func(vec![kw(KW_N, Int)], None, Str);
// TODO: overload: Iterable(Int) -> Bytes let t_bytes = func0(mono(BYTES))
let t_bytes = func( & func(
vec![],
None,
vec![kw(KW_STR, Str), kw(KW_ENCODING, Str)], vec![kw(KW_STR, Str), kw(KW_ENCODING, Str)],
None,
vec![kw(KW_ERRORS, Str)],
mono(BYTES),
)
& nd_func(
// TODO: Bytes-like
vec![pos(poly(ITERABLE, vec![ty_tp(Nat)]) | Nat | mono(BYTES))],
None,
mono(BYTES), mono(BYTES),
); );
let t_bytes_array = func( let t_bytes_array = func(