2012-04-25 10:40:18 -05:00
|
|
|
// Tests the passing down of expected types through boxing and
|
|
|
|
// wrapping in a record or tuple. (The a.x would complain about 'this
|
|
|
|
// type must be known in this context' if the passing down doesn't
|
|
|
|
// happen.)
|
|
|
|
|
|
|
|
fn eat_tup(_r: ~@(int, fn@({x: int, y: int}) -> int)) {}
|
|
|
|
fn eat_rec(_r: @~{a: int, b: fn@({x: int, y: int}) -> int}) {}
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-30 18:19:07 -05:00
|
|
|
eat_tup(~@(10, |a| a.x ));
|
|
|
|
eat_rec(@~{a: 10, b: |a| a.x });
|
2012-04-25 10:40:18 -05:00
|
|
|
}
|