Skip to content

Compiler should reject doubly declared function #44

@morganthomas

Description

@morganthomas

I expect the following example to fail to compile because it declares a twice with the same type signature:

    fn a() -> 1 {
        return 0;
    }

    fn a() -> 1 {
        return 1;
    }

    fn main() {
        a();
        return;
    }

This example appears to compile. To illustrate the issue, I made this draft PR where I added a failing test case: #43

Question: What is the expected behavior in the case of two function declarations with the same name and different type signatures? Is it allowed to overload the same name and allow the types to disambiguate, or should all functions be required to have distinct names?

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