navid/haze / ea08ceb46539df9cf3ac396bc0bd66fc4f6b9adc630e1596e79b8e4d3101673a / 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))
}