mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-api-digester: describing external type declarations as extensions in error messages
External type declarations are synthesized to incorporate members in extensions to types of external modules. In diagnostics, we should use 'extension' instead of 'struct/class' for these decls to avoid confusion.
This commit is contained in:
@@ -385,7 +385,15 @@ StringRef SDKNodeDecl::getScreenInfo() const {
|
||||
OS << "(" << HeaderName << ")";
|
||||
if (!OS.str().empty())
|
||||
OS << ": ";
|
||||
OS << getDeclKind() << " " << getFullyQualifiedName();
|
||||
bool IsExtension = false;
|
||||
if (auto *TD = dyn_cast<SDKNodeDeclType>(this)) {
|
||||
IsExtension = TD->isExternal();
|
||||
}
|
||||
if (IsExtension)
|
||||
OS << "Extension";
|
||||
else
|
||||
OS << getDeclKind();
|
||||
OS << " " << getFullyQualifiedName();
|
||||
return Ctx.buffer(OS.str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user