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

[SR-7092] Static members are available without qualification in nested types #49640

Open
swift-ci opened this issue Feb 27, 2018 · 1 comment

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 27, 2018

Previous ID SR-7092
Radar rdar://problem/37961655
Original Reporter Reitzig (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: c310772ab12f4dbf391b5a50ed9e4566

Issue Description:

Using Davide De Franceschi's example, the issue is exhibited by this code:

class A {
    static let superA = "a"
    
    func foo() {
        // Doesn't compile
        _ = superA
        // Compiles
        _ = A.superA
    }
    
    class Inner {
        func foo() {
            // Compiles
            _ = superA
        }
    }
}

While we need do qualify static class members in the (dynamic) class itself, it does not seem to be required in inner classes. Since the arguments for forbidding unqualified access apply just as well there, this seems like an oversight.

@moiseev
Copy link
Mannequin

moiseev mannequin commented Feb 28, 2018

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant