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

Member operators cannot be referenced using dot syntax

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:
      None

      Description

      Xcode does not complete static operator implementations. For example:

       

      struct Foo: Comparable {

          static func fooify(___ string: String) -> String {

              return "foo"

          }

          static func ==(lhs: Foo, rhs: Foo) -> Bool { return true }

          static func <(lhs: Foo, rhs: Foo) -> Bool { return true }

      }

      typealias Fooquatable = (Foo, Foo) -> Bool

       

       

       

      Neither `==` nor `<` is listed and you cannot refer to `Foo.==` or `Foo.<` in code.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              erica erica sadun
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: