New faults and syntax (#2034)

- Remove `[?]` syntax.
- Change `int!` to `int?` syntax.
- New `fault` declarations.
- Enum associated values can reference the calling enum.
This commit is contained in:
Christoffer Lerno
2025-03-10 00:11:35 +01:00
committed by GitHub
parent fefce25081
commit 25bccf4883
392 changed files with 3129 additions and 3658 deletions

View File

@@ -1,7 +1,7 @@
module conv_tests;
import std::io;
fn void! comparison_helper_32_to_8(Char32 c32, String expected_output)
fn void? comparison_helper_32_to_8(Char32 c32, String expected_output)
{
char[8] out;
usz len = conv::char32_to_utf8(c32, &out)!;
@@ -12,7 +12,7 @@ fn void! comparison_helper_32_to_8(Char32 c32, String expected_output)
}
}
fn void! comparison_helper_8_to_32(String in, Char32 c32)
fn void? comparison_helper_8_to_32(String in, Char32 c32)
{
usz len = in.len;
Char32 res = conv::utf8_to_char32(in.ptr, &len)!;