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-11581] Bad error message when @objc appears after Access Control modifier #53986

Open
an0 mannequin opened this issue Oct 7, 2019 · 2 comments
Open

[SR-11581] Bad error message when @objc appears after Access Control modifier #53986

an0 mannequin opened this issue Oct 7, 2019 · 2 comments
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 parser Area → compiler: The legacy C++ parser

Comments

@an0
Copy link
Mannequin

an0 mannequin commented Oct 7, 2019

Previous ID SR-11581
Radar None
Original Reporter @an0
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, Parser
Assignee None
Priority Medium

md5: 34ebce87c97e4de32d090fde1c322d78

Issue Description:

class Foo {

    private @objc func foo() {

    }

}

This causes Xcode to show this useless message:

Consecutive declarations on a line must be separated by ';'
Insert ';'
Expected declaration

Ideally, the order between "private" and "@objc" shouldn't matter. If it matters, Xcode should Fix it automatically by swapping the order.

@belkadan
Copy link
Contributor

belkadan commented Oct 7, 2019

All attributes go before all modifiers today, but you're right that the compiler should be friendly about it if that rule is maintained.

@belkadan
Copy link
Contributor

belkadan commented Oct 7, 2019

@rintaro, is this easy enough for a starter bug?

@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
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 parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

1 participant