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

Creating a reference to a protocol-based function crashes the compiler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Compiler
    • Labels:
    • Environment:

      Xcode 8, 9-beta. Swift 3, 3.1, 4.0

      Description

      ```
      protocol Test {
      func f()
      }
      let x = Test.f
      ```

      This crashes the compiler in all versions of swift from 4 back to at least 3.0. I would expect this to capture a function type `(Test) -> (Void) -> Void`, which I could then call with an instance of a concrete type that conforms to `Test`.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jlew Jeremy Lew
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: