rust/src/test/run-pass/deep.rs
Patrick Walton 147a2d655f Un-revert "Use different syntax for checks that matter to typestate", fixing the problem.
This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
2011-05-02 17:50:46 -07:00

15 lines
164 B
Rust

// -*- rust -*-
fn f(int x) -> int {
if (x == 1) {
ret 1;
} else {
let int y = 1 + f(x-1);
ret y;
}
}
fn main() {
assert (f(5000) == 5000);
}