diff options
author | Bad Diode <bd@badd10de.dev> | 2024-06-23 20:46:51 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2024-06-23 20:46:51 +0200 |
commit | a52097738e663f8bfea9b771c6f839f3dea9d901 (patch) | |
tree | 15bca360082a1aef2f85166096d26716e4f7eb93 /tests | |
parent | caf4d4c7dd0fff6cdf69bf8cb27f3bbb6d02a366 (diff) | |
download | bdl-a52097738e663f8bfea9b771c6f839f3dea9d901.tar.gz bdl-a52097738e663f8bfea9b771c6f839f3dea9d901.zip |
Add typechecking for if expressions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/semantics.bad | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/semantics.bad b/tests/semantics.bad index 158cec6..c316a3c 100644 --- a/tests/semantics.bad +++ b/tests/semantics.bad | |||
@@ -1,15 +1,25 @@ | |||
1 | ; let a:f32 = (1.0 + 2.0 * 2.0) / 2.0 | 1 | ; let a:f32 = (1.0 + 2.0 * 2.0) / 2.0 |
2 | 2 | ||
3 | let annotated:int = (1 + 2 * 2) / 2 | 3 | ; let annotated:int = (1 + 2 * 2) / 2 |
4 | let numbers = 1 | 4 | ; let numbers = 1 |
5 | let symbols = numbers | 5 | ; let symbols = numbers |
6 | let arith = 1 + 2 * 4 | 6 | ; let arith = 1 + 2 * 4 |
7 | let cmp = 1 <= 2 | 7 | ; let cmp = 1 <= 2 |
8 | let logic = !true && false || (1 <= 2) | 8 | ; let logic = !true && false || (1 <= 2) |
9 | let bits = 0xff & 0b00001111 | 9 | ; let bits = 0xff & 0b00001111 |
10 | let block = { | 10 | ; let block = { |
11 | let a = 1 + 2 | 11 | ; let a = 1 + 2 |
12 | a + 3 | 12 | ; a + 3 |
13 | ; } | ||
14 | |||
15 | let maybe = if (1 == 2) { | ||
16 | 32 | ||
17 | } else { | ||
18 | 44 | ||
19 | } | ||
20 | |||
21 | let single = if (true) { | ||
22 | 123 | ||
13 | } | 23 | } |
14 | 24 | ||
15 | ; enum test { | 25 | ; enum test { |