Undefined symbols with nested type inheritance

Originator:tomoya
Number:rdar://34455950 Date Originated:September 15 2017, 5:30 PM
Status:Open,DUPLICATE OF 32885384 Resolved:
Product:Developer Tools Product Version:9.0 GM
Classification:Bug Reproducible:Always
 
Summary:

Nested class with private/fileprivate methods could not be inherited in other frameworks. The nested type is defined in enum/struct/final class.


Steps to Reproduce:

1. git clone https://github.com/mitsuse/report-nested-type-inheritance
2. cd report-nested-type-inheritance && git checkout 9d0800d884334b38b9837a73ab476261c80ec53b
3. open ReportNestedTypeInheritance.xcodeproj
4. Build with the scheme B.


Expected Results:

Xcode can find symbols for methods of `A.X.Y`' and `B.Z` can inherit `A.X.Y` successfully.


Actual Results:

Build failed with errors as follow:

```
Undefined symbols for architecture arm64:
  "__T01A1XO1YC5test133_85030A24B48F8A101D9CEEE9CBF80A9ALLyyF", referenced from:
      __T01B1ZCN in B.o
  "__T01A1XO1YC5test233_85030A24B48F8A101D9CEEE9CBF80A9ALLyyF", referenced from:
      __T01B1ZCN in B.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```


Version/Build:

- Xcode 9.0 GM
- Swift 4.0


Configuration:

Please check the build settings etc. for details


Note: 

This problem is not reproduced in Swift Package Manager with similar configuration.
The below package-description is what I used with Swift Package Manager.

```
// swift-tools-version:4.0

import PackageDescription

let package = Package(
    name: "ReportNestedTypeInheritation",
    products: [
        .library(name: "B", targets: ["B"]),
    ],
    dependencies: [
    ],
    targets: [
        .target(name: "A", dependencies: []),
        .target(name: "B", dependencies: ["A"]),
    ]
)
```

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!