2012-03-05 18:27:27 -06:00
|
|
|
// error-pattern:unsatisfied precondition constraint (for example, even(y
|
2011-06-28 13:48:54 -05:00
|
|
|
|
2011-12-22 19:53:53 -06:00
|
|
|
fn print_even(y: int) : even(y) { log(debug, y); }
|
2011-06-28 13:48:54 -05:00
|
|
|
|
2011-08-23 20:25:50 -05:00
|
|
|
pure fn even(y: int) -> bool { true }
|
2011-06-28 13:48:54 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
2012-05-23 22:53:49 -05:00
|
|
|
let mut y: int = 42;
|
|
|
|
let mut x: int = 1;
|
2011-07-27 07:19:39 -05:00
|
|
|
check (even(y));
|
2012-03-09 18:11:56 -06:00
|
|
|
loop {
|
2011-07-27 07:19:39 -05:00
|
|
|
print_even(y);
|
2012-03-10 18:21:34 -06:00
|
|
|
while true { while true { while true { y += x; } } }
|
2011-06-29 17:11:20 -05:00
|
|
|
}
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|