mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
It's not something that /ought/ to happen, but when modules aren't quite set up properly (often by accident, thanks to header maps), we can get into basically this situation by having the definition end up in a header that's textually included into two different modules, or into a module and a bridging header. Handle that the same way we handle other redeclarations: have it show up in both modules. rdar://problem/45646620
18 lines
815 B
Swift
18 lines
815 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify -enable-objc-interop -I %S/Inputs/custom-modules/RedeclaredErrorEnum
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify -enable-objc-interop -I %S/Inputs/custom-modules/RedeclaredErrorEnum -DIMPORT_BASE
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -verify -enable-objc-interop -I %S/Inputs/custom-modules/RedeclaredErrorEnum -DIMPORT_BASE -Xcc -DNO_IMPORT_BASE_FROM_REDECLARED
|
|
|
|
#if IMPORT_BASE
|
|
import Base
|
|
#endif
|
|
|
|
import Redeclared
|
|
|
|
// Referencing this error type (defined in Base, redeclared in Redeclared)
|
|
// used to cause a compiler crash (rdar://problem/45414271).
|
|
_ = SomeError.self
|
|
_ = SomeError.Code.self
|
|
|
|
_ = Redeclared.SomeError.self
|
|
_ = Base.SomeError.self
|