Files
swift-mirror/test/ModuleInterface/module_shadowing.swift
Allan Shortlidge c2c8470dac ModuleInterface: Remove warning about types shadowing modules.
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.
2026-05-13 10:39:19 -07:00

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() }
}