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

Sema: Don't ignore current declaration if it's not ambiguous #19786

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akarpovskii
Copy link

This fixes #17872.

Previous logic was introduced in c17793b by @Vexu to address issue #12429. For the following piece of code there's no ambiguity and no reason to ignore the only declaration.

pub const Example = struct {
    usingnamespace struct {}; // works without this line

    pub fn foo() void {
        _ = Example.foo;  // error: struct 'main.Example' has no member named 'foo'
    }
};

pub fn main() !void {
    Example.foo();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function not visible inside itself through generic struct with usingnamespace
1 participant