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

Overloaded methods cannot be called using function call syntax #3088

Closed
jfecher opened this issue Oct 10, 2023 · 2 comments
Closed

Overloaded methods cannot be called using function call syntax #3088

jfecher opened this issue Oct 10, 2023 · 2 comments
Assignees
Labels
bug Something isn't working compiler frontend `noirc_frontend` crate

Comments

@jfecher
Copy link
Contributor

jfecher commented Oct 10, 2023

Aim

Trying to call an overloaded method using function call syntax:

struct Foo<T> {}

impl Foo<u32> {
    fn foo(self) -> Field { 1 }
}

impl Foo<u64> {
    fn foo(self) -> Field { 2 }
}

fn main() {
    let f: Foo<u32> = Foo{};
    assert(Foo::foo(f) == 1);
}

Expected Behavior

The program to execute without failure

Bug

error: Could not resolve 'foo' in path
   ┌─ /.../short/src/main.nr:15:17
   │
15 │     assert(Foo::foo(f) == 1);
   │                 ---
   │

Aborting due to 1 previous error
exit 1

To Reproduce

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@jfecher jfecher added bug Something isn't working compiler frontend `noirc_frontend` crate P-LOW labels Oct 10, 2023
@jfecher jfecher self-assigned this Oct 10, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 10, 2023
@asterite
Copy link
Collaborator

@jfecher I think this was fixed in #3087 but wasn't correctly linked, so we could close this. But let me know if this isn't correct! (the code doesn't seem to trigger the bug anymore)

@jfecher
Copy link
Contributor Author

jfecher commented Jul 23, 2024

@asterite this wasn't fixed by #3087 (rather that PR introduced this as a limitation) but it seems this was fixed sometime since then

@jfecher jfecher closed this as completed Jul 23, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler frontend `noirc_frontend` crate
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants