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

Error in parsing module interface when class have the same name with the framework

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Compiler
    • Environment:

      xcode 11.4 

      Description

      Problem

      The generated module interface file below will got an error when parsed by xcode. 

      // swift-interface-format-version: 1.0
      // swift-compiler-version: Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
      // swift-module-flags: -target x86_64-apple-ios8.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -Onone -module-name A
      @_exported import A
      import Foundation
      import Swift
      @_hasMissingDesignatedInitializers public class A {
        public typealias AnotherName = A.A
        public func hi() -> A.A.AnotherName
        @objc deinit
      }
      

      ("A" is the name of the framework)

      Source code 

      public class A {
          public typealias AnotherName = A
          public func hi() -> AnotherName {
              return A()
          }
      }
      

       

      Steps to Reproduce

      1. build a framework with the source above, with "Build Libraries for Distribution" enabled
      2. delete the .swiftinterface files in the framework
      3. add the generated framework to another project, import and build

      Why Important

      The module interface cannot be used , which means module stability never achieve its goal.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beccadax Becca Royal-Gordon
              Reporter:
              leavez leavez
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: