Skip to content

Compound assignment between boxed types results in LLVM assertion failure #631

Closed
@brson

Description

@brson

The following code

auto x = @10;
x += @20;

fails with "rustc: Instructions.cpp:1567: void llvm::BinaryOperator::init(llvm::Instruction::BinaryOps): Assertion `getType()->isIntOrIntVectorTy() && "Tried to create an integer operation on a non-integer type!"' failed."

This is probably because the typechecking code for binary operations is shared with that for compound assignment statements, but binary operations autoderef while assignment doesn't.

Not sure what is supposed to happen. Maybe this just shouldn't be allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions