rust/src/test/compile-fail/issue-2149.rs
2012-05-09 07:11:59 -07:00

11 lines
277 B
Rust

impl monad<A> for [A] {
fn bind<B>(f: fn(A) -> [B]) {
let mut r = fail;
for self.each {|elt| r += f(elt); }
//!^ WARNING unreachable expression
//!^^ ERROR the type of this value must be known
}
}
fn main() {
["hi"].bind {|x| [x] };
}