Odin icon indicating copy to clipboard operation
Odin copied to clipboard

'using _' with a pointer to struct as type in proc causes compiler assertion error

Open Lperlind opened this issue 3 years ago • 1 comments

Having the 'using' keyword with _ is a struct pointer type causes the following assertion to trigger:

src/llvm_backend_expr.cpp(3191): Assertion Failure: `e->using_expr != nullptr` value

Minimal reproduction case:

A :: struct {
    value: int,
}

call :: proc(using _: ^A) {
    value = 10
}

main :: proc() {
    a: A
    call(&a)
}

naming the parameter will not trigger the assertion

// this is fine as expected
call :: proc(using x: ^A) {
    value = 10
}

Lperlind avatar Feb 25 '22 07:02 Lperlind

This issue is still present

Lperlind avatar Oct 13 '22 22:10 Lperlind