Skip to content

Compound assignment (+=) on uninitialized variables is allowed #12527

@ben0x539

Description

@ben0x539

This compiles:

fn main() {
    let i: int;
    i += 2;
}

Now, I can't seem to get that anything reads the value again to compile, but it seems like bad times anyway.

Thought to try this because of #12452.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions