Skip to content

Commit fd7dd78

Browse files
authored
Merge pull request #82927 from hamishknight/sorted
[IDE] Fix sort predicate in `printCodeCompletionLookedupTypeNames`
2 parents c3fdab2 + adbbb9e commit fd7dd78

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ printCodeCompletionLookedupTypeNames(ArrayRef<NullTerminatedStringRef> names,
13791379
sortedNames.append(names.begin(), names.end());
13801380
llvm::sort(sortedNames,
13811381
[](NullTerminatedStringRef a, NullTerminatedStringRef b) {
1382-
return a.compare(b) <= 0;
1382+
return a.compare(b) < 0;
13831383
});
13841384

13851385
OS << "LookedupTypeNames: [";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"complete","signature":"void std::__1::__introsort<std::__1::_ClassicAlgPolicy, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, swift::NullTerminatedStringRef*, false>(swift::NullTerminatedStringRef*, swift::NullTerminatedStringRef*, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, std::__1::iterator_traits<swift::NullTerminatedStringRef*>::difference_type, bool)"}
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
{
4+
$1 == [$1 ]#^^#

validation-test/IDE/crashers/539adae64314fae.swift renamed to validation-test/IDE/crashers_fixed/539adae64314fae.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// {"kind":"complete","signature":"void std::__1::__introsort<std::__1::_ClassicAlgPolicy, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, swift::NullTerminatedStringRef*, false>(swift::NullTerminatedStringRef*, swift::NullTerminatedStringRef*, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, std::__1::iterator_traits<swift::NullTerminatedStringRef*>::difference_type, bool)","useGuardMalloc":true}
2-
// RUN: env DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3-
// REQUIRES: OS=macosx
4-
// REQUIRES: no_asan
5-
// REQUIRES: target-same-as-host
1+
// {"kind":"complete","signature":"void std::__1::__introsort<std::__1::_ClassicAlgPolicy, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, swift::NullTerminatedStringRef*, false>(swift::NullTerminatedStringRef*, swift::NullTerminatedStringRef*, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, std::__1::iterator_traits<swift::NullTerminatedStringRef*>::difference_type, bool)"}
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
63
struct a<each b: Collection
74
{
85
c: (repeat each b.Index
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"kind":"complete","signature":"void std::__1::__introsort<std::__1::_ClassicAlgPolicy, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, swift::NullTerminatedStringRef*, false>(swift::NullTerminatedStringRef*, swift::NullTerminatedStringRef*, printCodeCompletionLookedupTypeNames(llvm::ArrayRef<swift::NullTerminatedStringRef>, llvm::raw_ostream&)::$_0&, std::__1::iterator_traits<swift::NullTerminatedStringRef*>::difference_type, bool)"}
2+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
(.1.a - a)#^^#

0 commit comments

Comments
 (0)