2011-07-25 16:57:27 -07:00
|
|
|
// error-pattern: mismatched types
|
|
|
|
|
|
|
|
// Make sure that fn-to-block coercion isn't incorrectly lifted over
|
|
|
|
// other tycons.
|
|
|
|
|
2011-09-12 11:27:30 +02: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 16:57:27 -07:00
|
|
|
ret lol(fn_id, b);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-19 15:16:48 -07:00
|
|
|
fn main() { let i = 8; let f = coerce(block () { log_err i; }); f(); }
|