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,13 +51,19 @@ impl Context {
NoneType,
);
let t_bin = nd_func(vec![kw(KW_N, Int)], None, Str);
// TODO: overload: Iterable(Int) -> Bytes
let t_bytes = func(
vec![],
None,
vec![kw(KW_STR, Str), kw(KW_ENCODING, Str)],
mono(BYTES),
);
let t_bytes = func0(mono(BYTES))
& func(
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),
);
let t_bytes_array = func(
vec![],
None,