Allow closure arguments types to unify even if we can't fully resolve

a trait obligation. Partial fix for #16440 -- closure return types are
not handled yet.
This commit is contained in:
Niko Matsakis 2015-02-02 11:52:08 -05:00
parent 3d072a193b
commit c9e1c445db
2 changed files with 63 additions and 22 deletions

View file

@ -14,6 +14,6 @@ fn foo(i: int) -> int { i + 1 }
fn apply<A, F>(f: F, v: A) -> A where F: FnOnce(A) -> A { f(v) }
pub fn main() {
let f = {|: i| foo(i)};
let f = {|i| foo(i)};
assert_eq!(apply(f, 2), 3);
}