Uploaded image for project: 'Swift'
  1. Swift
  2. SR-3168

Missing fix-it for "'optional' can only be applied to protocol members"

    XMLWordPrintable

    Details

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

        Attachments

          Activity

            People

            Assignee:
            jrose Jordan Rose
            Reporter:
            jrose Jordan Rose
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: