Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple impls of the same trait & object type allowed when the associated types or constants differ #6811

Open
jfecher opened this issue Dec 13, 2024 · 0 comments · May be fixed by #7047
Open
Labels
bug Something isn't working

Comments

@jfecher
Copy link
Contributor

jfecher commented Dec 13, 2024

Aim

trait Foo {
    let N: u32;

    fn get_array(self) -> [Self; N];
}

impl Foo for Field {
    let N = 2;

    fn get_array(self) -> [Self; Self::N] {
        [1, 2]
    }
}

impl Foo for Field {
    let N = 3;

    fn get_array(self) -> [Self; Self::N] {
        [1, 2, 3]
    }
}

fn main(x: Field) {
    x.get_array();
}

Expected Behavior

Expected an error that there are two impl Foo for Field

Bug

No error - the program compiles without any related warnings

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

1 participant