2011-07-25 18:57:27 -05:00
|
|
|
// error-pattern: mismatched types
|
|
|
|
|
|
|
|
// Make sure that fn-to-block coercion isn't incorrectly lifted over
|
|
|
|
// other tycons.
|
|
|
|
|
2011-09-12 04:27:30 -05:00
|
|
|
fn coerce(b: block()) -> fn() {
|
|
|
|
fn lol(f: fn(block()) -> fn(), g: block()) -> fn() { ret f(g); }
|
|
|
|
fn fn_id(f: fn()) -> fn() { ret f }
|
2011-07-25 18:57:27 -05:00
|
|
|
ret lol(fn_id, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-12-22 16:42:52 -06:00
|
|
|
fn main() {
|
|
|
|
let i = 8;
|
2011-12-22 19:53:53 -06:00
|
|
|
let f = coerce(block () { log(error, i); });
|
2011-12-22 16:42:52 -06:00
|
|
|
f(); }
|