Skip to content

Assigning a function to a variable causes an assertion failure #333

Closed
@catamorphism

Description

@catamorphism

Compiling this program with rustc:

fn quux[T]() -> T {
  auto f = id[T];
 }

fn id[T](&T x) -> T {
    ret x;
}

yields an assertion failure:

"Assertion failed: (getOperand(0)->getType() == cast(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file Instructions.cpp, line 962."

Perhaps one is supposed to use bind or something for assigning id[T] to a variable, but it would be better to have a friendlier error message...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions