mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
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:
committed by
GitHub
parent
fefce25081
commit
25bccf4883
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user