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

@@ -12,8 +12,8 @@ fn void test_float() @test
assert(String.to_float("-23.545")!! == -23.545f);
assert(String.to_float("1.5555555555555")!! == 1.5555555555555f);
assert(String.to_float("1.5555555555556666")!! == 1.5555555555556666f);
test::@error("+".to_float(), NumberConversion.MALFORMED_FLOAT);
test::@error("-".to_float(), NumberConversion.MALFORMED_FLOAT);
test::@error("+".to_float(), string::MALFORMED_FLOAT);
test::@error("-".to_float(), string::MALFORMED_FLOAT);
}
fn void test_double() @test
@@ -28,6 +28,6 @@ fn void test_double() @test
assert(String.to_double("-23.545")!! == -23.545);
assert(String.to_double("1.5555555555555")!! == 1.5555555555555);
assert(String.to_double("1.5555555555556666")!! == 1.5555555555556666);
test::@error("+".to_double(), NumberConversion.MALFORMED_FLOAT);
test::@error("-".to_double(), NumberConversion.MALFORMED_FLOAT);
test::@error("+".to_double(), string::MALFORMED_FLOAT);
test::@error("-".to_double(), string::MALFORMED_FLOAT);
}