Files
swift-mirror/test/ClangImporter/enum-error-redeclared.swift
Jordan Rose 647dd402d5 [ClangImporter] NS_ERROR_ENUMs can be redefined in separate modules (#20527)
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
2018-11-13 10:17:16 -08:00

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