Skip to content

Commit 03b9190

Browse files
authored
Merge pull request #85750 from hamishknight/fuzzy
[test] Add some more known crashers
2 parents 1a3a9a9 + 272638a commit 03b9190

11 files changed

+91
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// https://github.com/swiftlang/swift/issues/51844
2+
3+
func doStuff(_ handler: () -> Void) { }
4+
5+
// CHECK: [[@LINE+1]]:17-[[@LINE+1]]:22 source.refactoring.range.kind.basename
6+
func merge<T>(_ param: T) {
7+
func makeHandler(_ successHandler: (T) -> T) -> () -> Void {
8+
return {}
9+
}
10+
// RUN: %sourcekitd-test -req=find-local-rename-ranges -pos=%(line+1):42 %s -- %s | %FileCheck %s
11+
doStufff(makeHandler { (success: T) in param})
12+
// CHECK: [[@LINE-1]]:42-[[@LINE-1]]:47 source.refactoring.range.kind.basename
13+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"complete","original":"186a3233","signature":"swift::ReferenceStorageType::get(swift::Type, swift::ReferenceOwnership, swift::ASTContext const&)","signatureAssert":"Assertion failed: (!T->hasTypeVariable()), function get"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
struct a<b{ c: b weak var d = \ c {
4+
a()#^^#
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// {"kind":"complete","original":"ee63e244","signature":"swift::rewriting::RequirementMachine::getReducedTypeParameter(swift::CanType, llvm::ArrayRef<swift::GenericTypeParamType*>) const"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
protocol a {
4+
associatedtype b
5+
struct c: a {
6+
#^^#
7+
}
8+
d(b )
9+
#e {
10+
d
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
2+
// https://github.com/swiftlang/swift/issues/65817
3+
protocol Publisher<Output, Failure> {
4+
associatedtype Output
5+
associatedtype Failure : Error
6+
}
7+
func pnReceive<P: Publisher>(_ publisher: P) where P.Failure == Never
8+
func test() {
9+
pnReceive(#^COMPLETE^#) { }
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
2+
// https://github.com/swiftlang/swift/issues/75898
3+
extension Result {
4+
typealias Value = Success
5+
6+
init(value: Value) {}
7+
8+
func tryMap() {
9+
return flatMap { value in }#^COMPLETE^#
10+
}
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %batch-code-completion
2+
// https://github.com/swiftlang/swift/issues/66785
3+
4+
0...31127...159768...8791155...11591160...11611425...14691471...14711473...14741476...14771479...#^COMPLETE^#
5+
// COMPLETE: Literal[Integer]/None: 0[#Int#]; name=0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// {"kind":"typecheck","original":"bc1e9cdf","signature":"(anonymous namespace)::AssociatedTypeInference::solve()","signatureAssert":"Assertion failed: (!hasTypeParameter() && \"already have an interface type\"), function mapTypeOutOfEnvironment"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: OS=macosx
4+
import Distributed
5+
distributed actor Distributed<DefaultDistributedActorSystem> {
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"typecheck","original":"7048f9d7","signature":"swift::KeyPathExpr::getKeyPathType() const","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
{
4+
convenience #a(\array)
5+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// {"kind":"emit-sil","original":"96451f18","signature":"(anonymous namespace)::LifetimeChecker::getLivenessAtInst(swift::SILInstruction*, unsigned int, unsigned int)","signatureAssert":"Assertion failed: (E <= size() && \"Attempted to set out-of-bounds range!\"), function set"}
2+
// RUN: not --crash %target-swift-frontend -emit-sil %s
3+
struct a<b> {
4+
let c: String
5+
let d: b
6+
}
7+
extension a where b == Void {
8+
init() {
9+
d <= ()
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// {"kind":"typecheck","original":"30ab265f","signature":"formatDiagnosticArgument(llvm::StringRef, llvm::StringRef, llvm::ArrayRef<swift::DiagnosticArgument>, unsigned int, swift::DiagnosticFormatOptions, llvm::raw_ostream&)","signatureAssert":"Assertion failed: ((!ModifierArguments.empty() || foundPipe) && \"Index beyond bounds in %select modifier\"), function formatSelectionArgument"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: OS=macosx
4+
// REQUIRES: objc_interop
5+
import Foundation
6+
@objc protocol a {
7+
optional var name: String
8+
}
9+
extension NSObject: a {
10+
var names = <#expression#>
11+
}

0 commit comments

Comments
 (0)