bolt/bootstrap/js/compiler/src/test/mutual-recursion-2.bolt

17 lines
222 B
Text
Raw Normal View History

2023-08-11 12:27:28 +02:00
let is_even x.
if x == 0.
return True
else.
return is_odd (x-1)
let is_odd x.
if x == 1.
return False
else.
return is_even (x-1)
@:Bool is_even 1
# @expect_diagnostic "TypeMismatch"
is_even True