Skip to content

Both operands to ICmp instruction are not of the same type! #2149

Closed
@jruderman

Description

@jruderman
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions