mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] rename some isXXX methods to getAsXXX
There's a group of methods in `DeclContext` with names that start with *is*, such as `isClassOrClassExtensionContext()`. These names suggests a boolean return value, while the methods actually return a type declaration. This patch replaces the *is* prefix with *getAs* to better reflect their interface.
This commit is contained in:
@@ -635,7 +635,7 @@ ArrayRef<ValueDecl *>
|
||||
NominalTypeDecl::getSatisfiedProtocolRequirementsForMember(
|
||||
const ValueDecl *member,
|
||||
bool sorted) const {
|
||||
assert(member->getDeclContext()->isNominalTypeOrNominalTypeExtensionContext()
|
||||
assert(member->getDeclContext()->getAsNominalTypeOrNominalTypeExtensionContext()
|
||||
== this);
|
||||
assert(!isa<ProtocolDecl>(this));
|
||||
prepareConformanceTable();
|
||||
@@ -654,7 +654,7 @@ DeclContext::getLocalProtocols(
|
||||
SmallVector<ProtocolDecl *, 2> result;
|
||||
|
||||
// Dig out the nominal type.
|
||||
NominalTypeDecl *nominal = isNominalTypeOrNominalTypeExtensionContext();
|
||||
NominalTypeDecl *nominal = getAsNominalTypeOrNominalTypeExtensionContext();
|
||||
if (!nominal)
|
||||
return result;
|
||||
|
||||
@@ -687,7 +687,7 @@ DeclContext::getLocalConformances(
|
||||
SmallVector<ProtocolConformance *, 2> result;
|
||||
|
||||
// Dig out the nominal type.
|
||||
NominalTypeDecl *nominal = isNominalTypeOrNominalTypeExtensionContext();
|
||||
NominalTypeDecl *nominal = getAsNominalTypeOrNominalTypeExtensionContext();
|
||||
if (!nominal)
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user