navid/haze / 8ad27175ea7468984a380df035464efe6200afefbd75a9fe1bfd354d46029e85 / samples/baseline_2.2/generic_pure_postcondition.hz
generic_pure_postcondition.hz
← samples/baseline_2.2 · 212 bytes · raw · download
pure fn choose[T](a T, b T, first bool) T
: post r => r == a || r == b
=> if first {
a
} else {
b
}
fn main() {
print(choose(10, 20, true))
print(choose(10, 20, false))
}