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-4695] Access control inconsistency #47272

Open
dabrahams opened this issue Apr 25, 2017 · 2 comments
Open

[SR-4695] Access control inconsistency #47272

dabrahams opened this issue Apr 25, 2017 · 2 comments
Assignees
Labels
access control Feature → modifiers: Access control and access levels bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-4695
Radar rdar://problem/31821367
Original Reporter @dabrahams
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AccessControl
Assignee @belkadan
Priority Medium

md5: 50b7faafb1fe405ba924a728bcbd09bf

Issue Description:

I think this program should compile, but even if it shouldn't, it should consistently give the same error for both instances of f, right?

public protocol P {
  associatedtype A
}

internal protocol Q : P {}
extension Q where A == ()  {
  public func f() {  } // error: cannot declare a public instance method in an extension with internal requirements
}

internal protocol R : P {}
extension R {
  public func f() {  } // OK
}
@dabrahams
Copy link
Collaborator Author

@swift-ci create

@belkadan
Copy link
Contributor

Yeah, this is me cheating on constrained extensions out of fear of accidentally exposing something we shouldn't. Thanks for the report; I'll check for an earlier one.

@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
Labels
access control Feature → modifiers: Access control and access levels bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants