{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/23728","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/23728/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/23728/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/23728/events","html_url":"https://github.com/rust-lang/rust/issues/23728","id":64451549,"number":23728,"title":"Type inferencer probably could figure this case out (associated types)","user":{"login":"carllerche","id":6180,"avatar_url":"https://avatars.githubusercontent.com/u/6180?v=3","gravatar_id":"","url":"https://api.github.com/users/carllerche","html_url":"https://github.com/carllerche","followers_url":"https://api.github.com/users/carllerche/followers","following_url":"https://api.github.com/users/carllerche/following{/other_user}","gists_url":"https://api.github.com/users/carllerche/gists{/gist_id}","starred_url":"https://api.github.com/users/carllerche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carllerche/subscriptions","organizations_url":"https://api.github.com/users/carllerche/orgs","repos_url":"https://api.github.com/users/carllerche/repos","events_url":"https://api.github.com/users/carllerche/events{/privacy}","received_events_url":"https://api.github.com/users/carllerche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-26T06:34:09Z","updated_at":"2015-03-26T06:34:09Z","closed_at":null,"body":"```rust\r\ntrait Async {\r\n    type Value;\r\n    type Error;\r\n}\r\n\r\nenum Result<T, E> {\r\n    Ok(T),\r\n    Err(E),\r\n}\r\n\r\nimpl<T, E> Result<T, E> {\r\n    fn reduce<F, U>(self, init: U::Value, action: F) -> U::Value\r\n            where F: Fn(U::Value, T) -> U,\r\n                  U: Async<Error=E> {\r\n        unimplemented!();\r\n    }\r\n}\r\n\r\nimpl Async for i32 {\r\n    type Value = i32;\r\n    type Error = ();\r\n}\r\n\r\npub fn main() {\r\n    let res: Result<&'static str, ()> = Result::Ok(\"hello\");\r\n    let val: i32 = 123;\r\n\r\n    res.reduce(val, |val /* i32 */, curr| val);\r\n    // Compiles if annotated ^^\r\n}\r\n```\r\n\r\ncc @nikomatsakis "}}