hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 5e371b0e3b8552ca3ad514e5517172edecdcee51
parent 4afcd76b8983a14ada118d14952c56f5cf99077f
Author: Sebastian <sebastian@sebsite.pw>
Date:   Thu,  5 Jan 2023 18:04:53 -0500

all: only type assert into direct members of tagged union

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mencoding/hex/hex.ha | 2+-
Mhare/lex/+test.ha | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/encoding/hex/hex.ha b/encoding/hex/hex.ha @@ -188,7 +188,7 @@ export fn decodestr(s: str) ([]u8 | io::error) = { defer free(s); assert(bytes::equal(s, [0xCA, 0xFE, 0xBA, 0xBE, 0xDE, 0xAD, 0xF0, 0x0D])); - decodestr("this is not hex") as errors::invalid: void; + decodestr("this is not hex") as io::error as errors::invalid: void; }; // Outputs a dump of hex data alongside the offset and an ASCII representation diff --git a/hare/lex/+test.ha b/hare/lex/+test.ha @@ -310,7 +310,7 @@ fn loc(line: uint, col: uint) location = location { let buf = bufio::fixed(in, mode::READ); let lexer = init(&buf, "<test>"); - const s = lex(&lexer) as syntax; + const s = lex(&lexer) as error as syntax; assert(s.1 == "Source file is not valid UTF-8"); };