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-5615] QoI: improve "'public' modifier cannot be used in protocols" #48185

Closed
belkadan opened this issue Aug 1, 2017 · 2 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers

Comments

@belkadan
Copy link
Contributor

belkadan commented Aug 1, 2017

Previous ID SR-5615
Radar rdar://problem/23134043
Original Reporter @belkadan
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee macko (JIRA)
Priority Medium

md5: 8c5d3f5f2748b48b5ea3f95e260d8c67

Issue Description:

public protocol Foo {
  public var bar: Int { get }
}
<stdin>:2:5: error: 'public' modifier cannot be used in protocols
    public var bar: Int
    ^~~~~~~

Rather than just flatly reject the code, the error message should explain what's going on, perhaps something like "protocol requirements implicitly have the same access as the protocol".

@swift-ci
Copy link
Collaborator

Comment by Jeffrey Macko (JIRA)

Hi,

I will try this one it will be my fist attempt to fix some issue on Swift Compiler. Do you only want replacing some text for this fix ?

I already have swift compiling on my computer and I think I just have to edit swift/include/swift/AST/DiagnosticsSema.def and change the text of access_control_in_protocol ?

@swift-ci
Copy link
Collaborator

Comment by Jeffrey Macko (JIRA)

Fix #11652

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants