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

associatedType having a default type is broken with more than two use

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:
      None

      Description

      Minimum code is here.

      protocol P {
          associatedtype X = Int
      
          func f1(_ x: X)
          func f2(_ x: X)
      }
      
      struct S: P {
          func f1(_ x: X) {}
          func f2(_ x: X) {}
      }
       
      error: reference to invalid associated type 'X' of type 'S'
          func f2(_ x: X) {}
      

        Attachments

          Activity

            People

            Assignee:
            yuta_saito Yuta Saito
            Reporter:
            yuta_saito Yuta Saito
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: