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:
parent
ff290bc582
commit
0846fe2d5f
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue