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-3168] Missing fix-it for "'optional' can only be applied to protocol members" #45756

Closed
belkadan opened this issue Nov 9, 2016 · 1 comment
Assignees
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement

Comments

@belkadan
Copy link
Contributor

belkadan commented Nov 9, 2016

Previous ID SR-3168
Radar rdar://problem/25583673
Original Reporter @belkadan
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, StarterBug
Assignee @belkadan
Priority Medium

md5: 3712ee5c89fa28d178516e90e2ba9a8f

Issue Description:

import UIKit

class C: NSObject, UICollectionViewDelegate {
    optional internal func indexPathForPreferredFocusedView(in collectionView: UICollectionView) -> IndexPath? {
        return nil
    }
}
<stdin>:5:5: error: 'optional' can only be applied to protocol members
    optional internal func indexPathForPreferredFocusedView(in collectionView: UICollectionView) -> IndexPath? {
    ^

There should be a fix-it to remove the "optional".

@robinkunde
Copy link
Contributor

Pull request: #5717

@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
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement
Projects
None yet
Development

No branches or pull requests

2 participants