Skip to content

Compiler panics when trying to create a mutable reference of an undefined variable #1985

@iAmMichaelConnor

Description

@iAmMichaelConnor

This isn't blocking anything, so not a high priority. It's just something I stumbled upon.

fn my_mutating_fn(a: &mut Field) {
    a += 10;
}

fn main(mut a: Field) -> pub Field {
    my_mutating_fn(&mut a);
    a
}
image

I'd have expected + to work here.

Compiled using the latest master, from source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions