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

Compile-time segmentation fault while referencing protocol method

    XMLWordPrintable

    Details

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

      Description

      Declaring a reference to a protocol method results in a compile-time segmentation fault while emitting SIL:

      protocol ExampleProtocol {
          func example()
      }
      let example: (ExampleProtocol) -> () -> Void = ExampleProtocol.example
      

       
      Declaring this reference explicitly, however, compiles and functions correctly:

      let example: (ExampleProtocol) -> () -> Void = { example in { example.example() } }
      

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mpangburn Michael Pangburn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: