Skip to content

Fix BindOverload not being used for variables #739

@Snowy1803

Description

@Snowy1803

When overloading a variable, no error is produced, and the used variable is always set to the last. However, the constraint system is solved with all overloads, so if it is found unambiguous with the first choice, it crashes as GILGen then uses the last choice.

func consume(@unused value: Int) {}

func main() {
    let x = 42;
    let x = "Hello";
    consume(x);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsemaSemantic Analysis — includes Constraint System, Scope resolution, and Semantic Passes

    Type

    No type

    Projects

    Status

    Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions