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

Extensions on Typealiased Existential Protocols

    XMLWordPrintable

    Details

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

      Swift 4
      Xcode 9.0 beta (9M136h)

      Description

      Since extension A where Self: B is valid, and C is defined as any A that also inherits from B, extension C should be just as valid.

          protocol A {}
          protocol B {}
          typealias C = A & B // valid
      
          struct Foo: C {} // valid
      
          extension A where Self: B {} // valid
          extension C {} // Error: Non-nominal type 'C' (aka 'A & B') cannot be extended }}
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            altece Steven Brunwasser
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: