[test] Add some already-fixed crashers

This commit is contained in:
Hamish Knight
2025-11-19 09:07:23 +00:00
parent bac0856f27
commit c717e42af4
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
// https://github.com/swiftlang/swift/issues/51844
func doStuff(_ handler: () -> Void) { }
// CHECK: [[@LINE+1]]:17-[[@LINE+1]]:22 source.refactoring.range.kind.basename
func merge<T>(_ param: T) {
func makeHandler(_ successHandler: (T) -> T) -> () -> Void {
return {}
}
// RUN: %sourcekitd-test -req=find-local-rename-ranges -pos=%(line+1):42 %s -- %s | %FileCheck %s
doStufff(makeHandler { (success: T) in param})
// CHECK: [[@LINE-1]]:42-[[@LINE-1]]:47 source.refactoring.range.kind.basename
}

View File

@@ -0,0 +1,10 @@
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
// https://github.com/swiftlang/swift/issues/65817
protocol Publisher<Output, Failure> {
associatedtype Output
associatedtype Failure : Error
}
func pnReceive<P: Publisher>(_ publisher: P) where P.Failure == Never
func test() {
pnReceive(#^COMPLETE^#) { }
}

View File

@@ -0,0 +1,11 @@
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
// https://github.com/swiftlang/swift/issues/75898
extension Result {
typealias Value = Success
init(value: Value) {}
func tryMap() {
return flatMap { value in }#^COMPLETE^#
}
}