Files
swift-mirror/test/IDE/complete_tuple_label_in_keypath.swift
Alex Hoppen 32eff21977 [IDE] Remove "Begin completions" and "End completions" from test cases
These test lines weren't actually providing any value and were annoying to write. Let's jut remove them.
2023-03-22 09:07:17 -07:00

21 lines
622 B
Swift

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=COMPLETE | %FileCheck %s
func foo() -> [(Int, [Int])] {
var searchResults: [Int: [Int]] = [:]
searchResults
.map { $0 }
.sorted(by: \.#^COMPLETE^#key)
}
public extension Sequence {
func sorted<T: Comparable>(by keyPath: KeyPath<Element, T>) -> [Element] {
return sorted { a, b in
return a[keyPath: keyPath] > b[keyPath: keyPath]
}
}
}
// CHECK-DAG: Pattern/CurrNominal: key[#Int#];
// CHECK-DAG: Pattern/CurrNominal: value[#[Int]#];