Skip to content

Commit b3aea6e

Browse files
committed
GenericSignatureBuilder: Simplify RequirementRHS type
1 parent c292b11 commit b3aea6e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class GenericSignatureBuilder {
9595
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
9696

9797
using RequirementRHS =
98-
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
98+
llvm::PointerUnion<Type, LayoutConstraint>;
9999

100100
/// The location of a requirement as written somewhere in the source.
101101
typedef llvm::PointerUnion<const TypeRepr *, const RequirementRepr *>

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7138,11 +7138,8 @@ void GenericSignatureBuilder::dump(llvm::raw_ostream &out) {
71387138
case RequirementKind::SameType:
71397139
out << "\n ";
71407140
out << type.getString() << " == " ;
7141-
if (auto secondType = constraint.dyn_cast<Type>()) {
7142-
out << secondType.getString();
7143-
} else {
7144-
out << constraint.get<PotentialArchetype *>()->getDebugName();
7145-
}
7141+
auto secondType = constraint.get<Type>();
7142+
out << secondType.getString();
71467143
out << " [";
71477144
source->print(out, &Context.SourceMgr);
71487145
out << "]";

0 commit comments

Comments
 (0)