mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
There is a known issue with module interfaces where a type with the same name as a module will disrupt references to types in that module. Fully fixing it will require a new language feature (SR-898) which is not yet available. In the meantime, module interfaces support a workaround flag (“-Xfrontend -module-interface-preserve-types-as-written”) which prints an alternate form that usually works. However, you have to know to add this flag, and it’s not obvious because nothing breaks until a compiler tries to consume the affected module interface (or sometimes even one of its clients). This commit emits a warning during module interface emission whenever the module interface either imports a type with the same name as the module being built, or declares a type with the same name as a visible module. This lets the user know that the type may cause problems and they might need to implement a workaround.
6 lines
81 B
Swift
6 lines
81 B
Swift
public struct TestStruct {
|
|
public init() {}
|
|
}
|
|
|
|
public enum module_shadowing {}
|