Files
swift-mirror/test/Serialization/export_as_xrefs.swift
Alexis Laferrière 93e8a359e3 [Serialization] Ignore the exported module name for XRefs
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
2022-03-23 12:38:59 -07:00

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