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-1275] Implement SE-0025 - Scoped Access Level #43883

Closed
lattner mannequin opened this issue Apr 20, 2016 · 7 comments
Closed

[SR-1275] Implement SE-0025 - Scoped Access Level #43883

lattner mannequin opened this issue Apr 20, 2016 · 7 comments
Assignees
Labels
access control Feature → modifiers: Access control and access levels compiler The Swift compiler in itself feature A feature request or implementation swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented

Comments

@lattner
Copy link
Mannequin

lattner mannequin commented Apr 20, 2016

Previous ID SR-1275
Radar rdar://problem/25973176
Original Reporter @lattner
Type New Feature
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels New Feature
Assignee @CodaFi
Priority Medium

md5: 3369204b8349fbcdc570cd665b354246

relates to:

  • SR-2579 Private access is not always enforced correctly
  • SR-2209 Make a real "AccessScope" type and use it in access checking

Issue Description:

SE-0025 has been accepted, and needs an implementation. This involves several pieces of work:

Introduce a new "fileprivate" declmodifier, which has the Swift 2.2 "private" semantics.
Rework "private" decls to only being visible within their scope, not within the current file.
Implement fixit/migration hint to indicate whether a "private" decl should be marked fileprivate.

@Coeur
Copy link
Mannequin

Coeur mannequin commented Jun 18, 2016

SE-0025 naming proposal was:

  • internal / fileprivate / private

But as it gave some people confusion on how it scopes, I suggest revising to either:

  • internal / fileinternal / private

  • internal(module) / internal(file) / private

@lattner
Copy link
Mannequin Author

lattner mannequin commented Jun 18, 2016

If you would like to discuss aspects of the design, swift-evolution would be the right place for that discussion. Please familiarize yourself with the prior discussions on the topic.

@belkadan
Copy link
Contributor

Completed in b5003f4.

@CodaFi
Copy link
Member

CodaFi commented Jul 29, 2016

Thanks Jordan!

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 3, 2016

Comment by Dr. Tae (JIRA)

When using Xcode 8 beta 6 (which has implemented SE-0025) the following specific example from SE-0025 is supposed to be illegal but doesn't produce any errors.

and continues to treat this code as illegal:

struct Outer {
  private struct Inner {
    private typealias Value = Int
    var value: Value
  }
}

@belkadan
Copy link
Contributor

belkadan commented Sep 6, 2016

Huh. Can you file a separate bug for that?

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 8, 2016

Comment by Dr. Tae (JIRA)

Jordan, I filed a separate bug: SR-2579

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added feature A feature request or implementation access control Feature → modifiers: Access control and access levels swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented and removed new feature labels Nov 11, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
access control Feature → modifiers: Access control and access levels compiler The Swift compiler in itself feature A feature request or implementation swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented
Projects
None yet
Development

No branches or pull requests

4 participants