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

Methods from implementing traits should be visible #3948

Closed
Tracked by #2568
sirasistant opened this issue Jan 4, 2024 · 0 comments · Fixed by #3986
Closed
Tracked by #2568

Methods from implementing traits should be visible #3948

sirasistant opened this issue Jan 4, 2024 · 0 comments · Fixed by #3986
Labels
bug Something isn't working

Comments

@sirasistant
Copy link
Contributor

Aim

Implementing commonly used methods as traits

fn main() {
    let _val = foomod::Foo::default();
}

mod foomod {
    use dep::std::default::Default;

    struct Foo {
        a: u64,
        b: u64,
    }

    impl Default for Foo {
        fn default() -> Self {
            Foo { 
                a: Default::default(), 
                b: Default::default(), 
            }
        }
    }
}

Expected Behavior

Should not warn me about default not being visible

Bug

default is private and not visible from the current module

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

@sirasistant sirasistant added the bug Something isn't working label Jan 4, 2024
@Savio-Sou Savio-Sou mentioned this issue Jan 5, 2024
46 tasks
github-merge-queue bot pushed a commit that referenced this issue Jan 11, 2024
Resolves #3948

Functions implemented in Traits weren't being treated as public, which
resulted in `...is private and not visible from the current module`
warnings

This PR simply forces the creation of public functions in the AST at the
parser level.

---------

Co-authored-by: jfecher <jake@aztecprotocol.com>
Co-authored-by: Tom French <tom@tomfren.ch>
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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant