2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
// error-pattern: impure function used in constraint
|
|
|
|
|
|
|
|
fn f(int a, int b) : lt(a,b) {
|
|
|
|
}
|
|
|
|
|
2010-11-02 13:11:58 -05:00
|
|
|
impure fn lt(int a, int b) -> bool {
|
2010-06-23 23:03:09 -05:00
|
|
|
let port[int] p = port();
|
|
|
|
let chan[int] c = chan(p);
|
|
|
|
c <| 10;
|
2010-07-16 17:33:30 -05:00
|
|
|
ret true;
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let int a = 10;
|
|
|
|
let int b = 23;
|
|
|
|
check lt(a,b);
|
|
|
|
f(a,b);
|
|
|
|
}
|