When qualifying Clang types with a module, make sure we choose a visible module (#32465)

Clang types need special treatment because multiple Clang modules can contain the same type declarations from a textually included header, but not all of these modules may be visible.

This fixes
https://bugs.swift.org/browse/SR-13032

The newly added test breaks without this fix.
This commit is contained in:
martinboehme
2020-12-11 08:15:05 +01:00
committed by GitHub
parent 3a27c119e5
commit f4e74f7907
6 changed files with 109 additions and 8 deletions

View File

@@ -517,7 +517,7 @@ bool swift::emitSwiftInterface(raw_ostream &out,
printImports(out, Opts, M);
const PrintOptions printOptions = PrintOptions::printSwiftInterfaceFile(
Opts.PreserveTypesAsWritten, Opts.PrintFullConvention, Opts.PrintSPIs);
M, Opts.PreserveTypesAsWritten, Opts.PrintFullConvention, Opts.PrintSPIs);
InheritedProtocolCollector::PerTypeMap inheritedProtocolMap;
SmallVector<Decl *, 16> topLevelDecls;