about summary refs log tree commit diff
path: root/src/test/compile-fail/issue-2149.rs
blob: 6363ca5fb6c15498f23a0a9a3d032b0c7146f9b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
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] };
}