mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-api-digester: don't assume super classes are always present in the module dump.
When we compare the APIs of entire SDKs, we can assume super classes are always present in the API dump. However, this assumption is invalid for framework-level API diff checking, where super classes can come from other modules whose contents are not serialized. rdar://33110442
This commit is contained in:
@@ -729,8 +729,10 @@ public:
|
||||
Optional<SDKNodeTypeDecl*> getSuperclass() const {
|
||||
if (SuperclassUsr.empty())
|
||||
return None;
|
||||
return (*getRootNode()->getDescendantByUsr(SuperclassUsr))->
|
||||
getAs<SDKNodeTypeDecl>();
|
||||
if (auto SC = getRootNode()->getDescendantByUsr(SuperclassUsr)) {
|
||||
return (*SC)->getAs<SDKNodeTypeDecl>();
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
/// Finding the node through all children, including the inheritted ones,
|
||||
|
||||
Reference in New Issue
Block a user