hashc
hashc copied to clipboard
tc: confussion between `usize` and `u64`
The following snippet:
main := () => {
buf := [1u8; 4usize + 5usize]](buf: [u8; { 1usize + 1usize }] = [1u8, 1u8])
}
Should produce this behaviour:
The snippet should type check and produce no errors, instead, the typechecking reports an error that there is a mismatched between the types, where it wanted a usize
but got a u64
instead:
--> /Users/alex/projects/hash-org/hashc/examples/main.hash:2:17
1 | main := () => {
2 | buf: [u8; { 1usize + 1usize }] = [1u8, 1u8]
| ^^^^^^ this is of type `u64`
3 | }
There are probably other similar bugs where there is some confusion between usize
literals and them being treated as u64
s