mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-module-digester: diagnose type witness type changes when checking ABI stability.
This commit is contained in:
@@ -326,7 +326,7 @@ StringRef SDKNodeType::getParamValueOwnership() const {
|
||||
|
||||
StringRef SDKNodeType::getTypeRoleDescription() const {
|
||||
assert(isTopLevelType());
|
||||
auto P = cast<SDKNodeDecl>(getParent());
|
||||
auto P = getParent();
|
||||
switch(P->getKind()) {
|
||||
case SDKNodeKind::Root:
|
||||
case SDKNodeKind::TypeNominal:
|
||||
@@ -335,7 +335,6 @@ StringRef SDKNodeType::getTypeRoleDescription() const {
|
||||
case SDKNodeKind::DeclType:
|
||||
case SDKNodeKind::DeclOperator:
|
||||
case SDKNodeKind::Conformance:
|
||||
case SDKNodeKind::TypeWitness:
|
||||
llvm_unreachable("Type Parent is wrong");
|
||||
case SDKNodeKind::DeclFunction:
|
||||
case SDKNodeKind::DeclConstructor:
|
||||
@@ -350,6 +349,8 @@ StringRef SDKNodeType::getTypeRoleDescription() const {
|
||||
return "underlying";
|
||||
case SDKNodeKind::DeclAssociatedType:
|
||||
return "default";
|
||||
case SDKNodeKind::TypeWitness:
|
||||
return "type witness type";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,6 +441,11 @@ SDKNodeType *SDKNodeTypeWitness::getUnderlyingType() const {
|
||||
return getOnlyChild()->getAs<SDKNodeType>();
|
||||
}
|
||||
|
||||
StringRef SDKNodeTypeWitness::getWitnessedTypeName() const {
|
||||
return Ctx.buffer((llvm::Twine(getParent()->getAs<SDKNodeConformance>()->
|
||||
getName()) + "." + getName()).str());
|
||||
}
|
||||
|
||||
Optional<SDKNodeDeclType*> SDKNodeDeclType::getSuperclass() const {
|
||||
if (SuperclassUsr.empty())
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user