Skip to content

Commit 39335f4

Browse files
authored
Merge pull request #24272 from compnerd/not-equal
AST: inline the definition for `AnyValue::Holder<Type>::equals`
2 parents 2022b5c + c38f6ab commit 39335f4

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

include/swift/AST/TypeCheckRequests.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ class PropertyDelegateBackingPropertyInfoRequest :
550550
// Allow AnyValue to compare two Type values, even though Type doesn't
551551
// support ==.
552552
template<>
553-
bool AnyValue::Holder<Type>::equals(const HolderBase &other) const;
553+
inline bool AnyValue::Holder<Type>::equals(const HolderBase &other) const {
554+
assert(typeID == other.typeID && "Caller should match type IDs");
555+
return value.getPointer() ==
556+
static_cast<const Holder<Type> &>(other).value.getPointer();
557+
}
554558

555559
void simple_display(llvm::raw_ostream &out, const Type &type);
556560

lib/AST/TypeCheckRequests.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,6 @@ void swift::simple_display(
646646
out << " }";
647647
}
648648

649-
650-
template<>
651-
bool swift::AnyValue::Holder<Type>::equals(const HolderBase &other) const {
652-
assert(typeID == other.typeID && "Caller should match type IDs");
653-
return value.getPointer() ==
654-
static_cast<const Holder<Type> &>(other).value.getPointer();
655-
}
656-
657649
void swift::simple_display(llvm::raw_ostream &out, const Type &type) {
658650
if (type)
659651
type.print(out);

0 commit comments

Comments
 (0)