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

Trying to get a reference to a protocol's member crashes the compiler

    XMLWordPrintable

    Details

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

      Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3).

      Description

      protocol P {
         func f()
      }
      
      let a = P.f
      

      This currently causes the compiler to segfault.

      I actually don't know if the bug is that this doesn't work, or just that it doesn't have a good error message. Using keypaths of a protocol works (most of the time), so why shouldn't this work for non-static functions?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              benpious Ben Pious
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: