mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Write the real module name for XRefs in swiftmodule files instead of the exported module name, from `export_as` declarations in module maps. Swiftmodule files are internal details now, they should represent the truth. We keep using the exported module name for the extensions lookup table as clients should still use the exported name. However we may need to write both alternatives in the lookup table in the future if extensions can't be found from clients not importing the exported as module. rdar://90272035
20 lines
596 B
Swift
20 lines
596 B
Swift
/// Ensure that export_as decls don't cause a deserialization failure (even one if recovered from)
|
|
/// rdar://90272035
|
|
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -DLIB_A %s -module-name A -emit-module-path %t/A.swiftmodule -I %t -I %S/Inputs/exported-modules
|
|
// RUN: %target-swift-frontend -emit-module -DLIB_B %s -module-name B -emit-module-path %t/B.swiftmodule -I %t -I %S/Inputs/exported-modules -disable-deserialization-recovery
|
|
|
|
#if LIB_A
|
|
import ExportedCore
|
|
|
|
public func foo() -> ExportedType { fatalError() }
|
|
|
|
#elseif LIB_B
|
|
|
|
import A
|
|
|
|
let a = foo()
|
|
|
|
#endif
|