navid/haze / 13ba2f33894c67a16c9bf8afb859ffc1b9f11d054fe58f1e57ae1d2d57994a9b / samples/baseline_2.4/shadowing_gauntlet.hz
shadowing_gauntlet.hz
← samples/baseline_2.4 · 570 bytes · raw · download
const LIMIT i32 = 10
const n i32 = 100
const v i32 = 99
const i i32 = 42
type Box = | Empty | Full(v i32)
pure fn keep(n i32) i32 {
const x = n
{
const x = 1000
}
return x
}
fn below_limit(n i32) i32
: pre n < LIMIT
=> n
fn main() {
const n = 3
{
const n = 9
print(below_limit(n))
}
print(below_limit(n))
print(keep(7))
for i in 0..3
: invariant i <= 3
{
print(i)
}
const box = Full(5)
match box {
Full(v) => print(v)
Empty => print(0)
}
}