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

Regression on self-referential generic where clauses in Swift 5.1

    XMLWordPrintable

    Details

      Description

      In Swift 5.0.1 this declaration compiled successfully: 

      protocol Type {
        associatedtype Element
      }
      class GenericType<T: Type> where T.Element == GenericType {}
      // also fails: class GenericType<T> where T: Type, T.Element == GenericType {}
      // also fails: class GenericType<T> where T: Type, T.Element: GenericType {}

       

      But in Swift 5.1, it now results in an error:

      error: Illegal instruction: 4
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            andrewchang-bird Andrew Chang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: