Add test for issue 868

This commit is contained in:
Tim Chevalier 2012-07-26 14:29:24 -07:00
parent 96c6f57d18
commit d19b915bc4

View File

@ -0,0 +1,15 @@
fn f<T>(g: fn() -> T) -> T { g() }
fn main() {
let _x = f( | | { 10 });
// used to be: cannot determine a type for this expression
f(| | { });
// ditto
f( | | { ()});
// always worked
let _: () = f(| | { });
// empty block with no type info should compile too
let _ = f(||{});
let _ = (||{});
}