Skip to content

[SR-3168] Missing fix-it for "'optional' can only be applied to protocol members" #45756

@belkadan

Description

@belkadan
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".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions