Add new failing test case for 048 (clause guards)

It seems like we don't properly handle clause guards for wildcard
  patterns. Seems like a codegen issue here as the code type-check
  properly.
This commit is contained in:
KtorZ 2023-03-16 23:00:12 +01:00
parent ff290bc582
commit 0846fe2d5f
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 20 additions and 20 deletions

View File

@ -46,27 +46,27 @@ test foo_4() {
} }
} }
// type Seasons { type Seasons {
// Winter Winter
// Spring Spring
// Summer Summer
// Fall Fall
// } }
// fn is_cold(season, hour) { fn is_cold(season, hour) {
// when season is { when season is {
// Winter | Fall -> Winter | Fall ->
// True True
// _ if hour >= 18 -> _ if hour >= 18 ->
// True True
// _ -> _ ->
// False False
// } }
// } }
// test foo_5() { test foo_5() {
// !is_cold(Spring, 15) && is_cold(Summer, 22) !is_cold(Spring, 15) && is_cold(Summer, 22)
// } }
fn when_tuple(a: (Int, Int)) -> Int { fn when_tuple(a: (Int, Int)) -> Int {
when a is { when a is {
@ -75,6 +75,6 @@ fn when_tuple(a: (Int, Int)) -> Int {
} }
} }
test spend() { test foo_6() {
when_tuple((4, 1)) == 4 when_tuple((4, 1)) == 4
} }