mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This fixes a compiler bug that got exposed by f11abac652.
If a C++ type is declared in a nested Clang submodule, Swift was emitting errors that look like:
```
Type alias 'string' is not available due to missing import of defining module 'fwd’
```
rdar://146899125
21 lines
839 B
Swift
21 lines
839 B
Swift
// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=default
|
|
// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=default -enable-upcoming-feature MemberImportVisibility
|
|
// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=default -D IMPORT_TOP_LEVEL
|
|
// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=default -D IMPORT_ANOTHER_SUBMODULE
|
|
|
|
// REQUIRES: swift_feature_MemberImportVisibility
|
|
|
|
#if IMPORT_TOP_LEVEL
|
|
import TopLevelModule
|
|
#elseif IMPORT_ANOTHER_SUBMODULE
|
|
import TopLevelModule.SubModule.AnotherDeepSubModule
|
|
#else
|
|
import TopLevelModule.SubModule.DeepSubModule
|
|
#endif
|
|
|
|
let _: NS.MyStructInDeepSubModule! = nil
|
|
|
|
extension NS.MyStructInDeepSubModule {
|
|
public static func takesInstance(_ i: NS.MyStructInDeepSubModule) {}
|
|
}
|