Closed
Description
iface monad<A> {
fn bind<B>(fn(A) -> self<B>);
}
impl monad<A> of monad<A> for [A] {
fn bind<B>(f: fn(A) -> [B]) {
let mut r = fail;
for self.each {|elt| r += f(elt); }
}
}
fn main() {
["hi"].bind {|x| [x] };
}
rustc fails with:
Assertion failed: (getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"), function ICmpInst, file /Users/jruderman/code/rust/src/llvm/include/llvm/Instructions.h, line 958.