Skip to content

Commit 8e69dc5

Browse files
committed
AST: Remove TypeRepr::isInverseOf()
1 parent e026700 commit 8e69dc5

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

include/swift/AST/TypeRepr.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
137137
/// Is this type representation a protocol?
138138
bool isProtocolOrProtocolComposition(DeclContext *dc);
139139

140-
/// Is this `~<target>` representation.
141-
bool isInverseOf(InvertibleProtocolKind target,
142-
DeclContext *dc);
143-
144140
/// Is this type representation known to be invalid?
145141
bool isInvalid() const { return Bits.TypeRepr.Invalid; }
146142

lib/AST/NameLookup.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3406,29 +3406,6 @@ bool TypeRepr::isProtocolOrProtocolComposition(DeclContext *dc) {
34063406
return declsAreProtocols(references.first);
34073407
}
34083408

3409-
bool TypeRepr::isInverseOf(InvertibleProtocolKind target, DeclContext *dc) {
3410-
if (auto inverseTypeRepr = dyn_cast<InverseTypeRepr>(this)) {
3411-
auto *constraint = inverseTypeRepr->getConstraint();
3412-
3413-
auto &ctx = dc->getASTContext();
3414-
return llvm::any_of(
3415-
directReferencesForTypeRepr(ctx.evaluator, ctx, constraint, dc).first,
3416-
[&](const TypeDecl *decl) {
3417-
if (auto *P = dyn_cast<ProtocolDecl>(decl))
3418-
return P->getInvertibleProtocolKind() == target;
3419-
return false;
3420-
});
3421-
}
3422-
3423-
if (auto *composition = dyn_cast<CompositionTypeRepr>(this)) {
3424-
return llvm::any_of(composition->getTypes(), [&](TypeRepr *member) {
3425-
return member->isInverseOf(target, dc);
3426-
});
3427-
}
3428-
3429-
return false;
3430-
}
3431-
34323409
static GenericParamList *
34333410
createExtensionGenericParams(ASTContext &ctx,
34343411
ExtensionDecl *ext,

0 commit comments

Comments
 (0)