mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, the constraint solver would first attempt member lookup that excluded members from transitively imported modules. If there were no viable candidates, it would perform a second lookup that included the previously excluded members, treating any candidates as unviable. This meant that if the member reference did resolve to one of the unviable candidates the resulting AST would be broken, which could cause unwanted knock-on diagnostics. Now, members from transitively imported modules are always returned in the set of viable candidates. However, scoring will always prioritize candidates from directly imported modules over members from transitive imports. This solves the ambiguities that `MemberImportVisibility` is designed to prevent. If the only viable candidates are from transitively imported modules, though, then the reference will be resolved successfully and diagnosed later in `MiscDiagnostics.cpp`. The resulting AST will not contain any errors, which ensures that necessary access levels can be computed correctly for the imports suggested by `MemberImportVisibility` fix-its. Resolves rdar://126637855.
36 KiB
36 KiB