mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] Add some already-fixed crashers
This commit is contained in:
13
test/SourceKit/Refactoring/issue-51844.swift
Normal file
13
test/SourceKit/Refactoring/issue-51844.swift
Normal 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
|
||||
}
|
||||
10
validation-test/IDE/crashers_fixed/issue-65817.swift
Normal file
10
validation-test/IDE/crashers_fixed/issue-65817.swift
Normal 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^#) { }
|
||||
}
|
||||
11
validation-test/IDE/crashers_fixed/issue-75898.swift
Normal file
11
validation-test/IDE/crashers_fixed/issue-75898.swift
Normal 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^#
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user