mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
c2c8470dac
Now that module selectors (SE-0491) are used by default when printing .swiftinterface files, the following warning is unnecessary: ``` public struct <name> shadows module <name>, which may cause failures... ``` Remove the implementation of the warning entirely. Technically, we could keep diagnosing the issue when use of module selectors in .swiftinterface files is disabled via the `-disable-module-selectors-in-module-interface` flag, but on balance it does not seem worth it since we don't anticipate any uses of that flag aside from temporarily working around compiler bugs. Resolves rdar://176476640.
21 lines
1022 B
Swift
21 lines
1022 B
Swift
// RUN: %empty-directory(%t/lib)
|
|
|
|
// Build the ShadowyHorror module (contains 'public class module_shadowing').
|
|
// RUN: %target-swift-emit-module-interface(%t/lib/ShadowyHorror.swiftinterface) %S/Inputs/ShadowyHorror.swift -module-name ShadowyHorror
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/lib/ShadowyHorror.swiftinterface) -module-name ShadowyHorror
|
|
|
|
// Build this file as a module interface. Verify that no warnings are emitted
|
|
// when a typename shadows an imported module name.
|
|
// RUN: %target-swift-emit-module-interface(%t/module_shadowing.swiftinterface) %s -module-name module_shadowing -I %t/lib -verify
|
|
|
|
// Verify the generated .swiftinterface typechecks successfully.
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/module_shadowing.swiftinterface) -module-name module_shadowing -I %t/lib
|
|
|
|
import ShadowyHorror
|
|
|
|
// 'ShadowyHorror' shadows the imported module of the same name.
|
|
public struct ShadowyHorror {
|
|
public init() {}
|
|
public var property: ShadowyHorror { ShadowyHorror() }
|
|
}
|