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