mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ABI/API checker: avoid printing fully qualified names in generic signature
The heuristics to decide whether fully qualified type names should be printed may work differently when generating the baseline and when importing from just built frameworks. This patch makes it consistent so that such false positives won't happen. rdar://54276347
This commit is contained in:
@@ -1090,6 +1090,10 @@ StringRef printGenericSignature(SDKContext &Ctx, ArrayRef<Requirement> AllReqs)
|
||||
return StringRef();
|
||||
OS << "<";
|
||||
bool First = true;
|
||||
PrintOptions Opts = PrintOptions::printInterface();
|
||||
// We always print unqualifed type names to avoid false positives introduced
|
||||
// by the heuristics working differently.
|
||||
Opts.FullyQualifiedTypesIfAmbiguous = false;
|
||||
for (auto Req: AllReqs) {
|
||||
if (!First) {
|
||||
OS << ", ";
|
||||
@@ -1097,9 +1101,9 @@ StringRef printGenericSignature(SDKContext &Ctx, ArrayRef<Requirement> AllReqs)
|
||||
First = false;
|
||||
}
|
||||
if (Ctx.checkingABI())
|
||||
getCanonicalRequirement(Req).print(OS, PrintOptions::printInterface());
|
||||
getCanonicalRequirement(Req).print(OS, Opts);
|
||||
else
|
||||
Req.print(OS, PrintOptions::printInterface());
|
||||
Req.print(OS, Opts);
|
||||
}
|
||||
OS << ">";
|
||||
return Ctx.buffer(OS.str());
|
||||
|
||||
Reference in New Issue
Block a user