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

Support specifying generics on a type when calling an associated function #6000

Closed
TomAFrench opened this issue Sep 11, 2024 · 1 comment · Fixed by #6306
Closed

Support specifying generics on a type when calling an associated function #6000

TomAFrench opened this issue Sep 11, 2024 · 1 comment · Fixed by #6306
Assignees
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

TomAFrench commented Sep 11, 2024

We currently do not allow applying a turbofish to a struct type, attempting to do so will result in a UnsupportedTurbofishUsage error

struct Foo<T> {
    x: T
}

impl <T> Foo<T> {
    fn new(x: T) -> Self {
        Foo { x }
    }
}

fn main() {
    let _ = Foo::<i32>::new(1);
}

We should implement support for the turbofish syntax in this situation.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 11, 2024
@TomAFrench TomAFrench added the enhancement New feature or request label Sep 11, 2024
@asterite
Copy link
Collaborator

I think this is a duplicate of #5584

I added support for parsing the turbofishes in the middle of paths but implementing this particular case is kind of tricky.

@asterite asterite self-assigned this Oct 21, 2024
@asterite asterite moved this from 📋 Backlog to 🚧 Blocked in Noir Oct 24, 2024
@github-project-automation github-project-automation bot moved this from 🚧 Blocked to ✅ Done in Noir Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants