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

Extensions in different files do not recognize each other

    XMLWordPrintable

    Details

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

      Swift 2.1, OS X 10.11.2, Xcode 7.2, iOS 9.3

      Swift 3.0, OS X 10.12.2, Xcode 8.2, iOS 10.2

      Swift 4.1, macOS 10.13.4, Xcode 9.3, iOS 11.3.1

      Description

      This kind of setup does not work (Three different files).

      It does even autocomplete when typing the last file, but then it doesn't compile.

      class FirstClass { }
      
      extension FirstClass {
          class SecondClass { }
      }
      
      extension FirstClass.SecondClass { // Error here!
          class ThirdClass { }
      }
      

      The error is:

      "SecondClass is not a member type of FirstClass"
      

      On the first line of the last file.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              Claus Ruete Claus Ruete
              Votes:
              67 Vote for this issue
              Watchers:
              67 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: