Skip to content

Commit a810c72

Browse files
Merge pull request swiftlang#80325 from cachemeifyoucan/basedeclname-compare
2 parents d61c21b + f53c6a4 commit a810c72

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/AST/Identifier.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,11 @@ class DeclBaseName {
385385
}
386386

387387
int compare(DeclBaseName other) const {
388-
return userFacingName().compare(other.userFacingName());
388+
if (int result = userFacingName().compare(other.userFacingName()))
389+
return result;
390+
if (getKind() == other.getKind())
391+
return 0;
392+
return getKind() < other.getKind() ? -1 : 1;
389393
}
390394

391395
bool operator==(StringRef Str) const {

0 commit comments

Comments
 (0)