navid/haze / 90400c3cb2eb4f37a299a5eb96dbf6c3ad2fda3fc79b7a824ce800f18386f55d / tests/format/unformatted.hz
unformatted.hz
← tests/format · 507 bytes · raw · download
fn some_func ( ) {
var x i32=20
var y i64 = cast[i64](x)
print(y)
}
contract Positive(n i32){
pre n>0
}
fn classify ( n i32 ) i32
: Positive(n)
: post r=>r>=0 {
if n>0 {
return n
}
else {
return 0
}
}
fn main(){
var total=0
for i in 0..3
: invariant total>=0
{
total+=i
}
print(total)
}
fn chain ( xs list[i32] ) i32 {
var total=0
for x in xs
: invariant total>=0
{
total+=x
}
const ys=[
1,
2,
]
return -1
}
fn allman ( n i32 ) i32
{
return n
}