Skip to content

Commit 6de09e1

Browse files
committed
[test] Add some more known crashers
1 parent adb40dd commit 6de09e1

File tree

10 files changed

+68
-0
lines changed

10 files changed

+68
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"complete","original":"8af9696a","signature":"(anonymous namespace)::TypePrinter::printWithParensIfNotSimple(swift::Type)","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
// REQUIRES: OS=macosx
4+
import Foundation
5+
var a: some NSMutableArray = a == #^^# = <#expression#>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// {"kind":"complete","original":"8b824012","signature":"swift::Mangle::ASTMangler::appendBoundGenericArgs(swift::DeclContext*, swift::GenericSignature, swift::SubstitutionMap, bool&, swift::ValueDecl const*)","signatureAssert":"Assertion failed: (Index < Length && \"Invalid index!\"), function operator[]"}
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+
struct b {
5+
var c: (some Any, Int) {
6+
#^^#
7+
}
8+
}
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"kind":"complete","original":"2201e4ed","signature":"swift::Mangle::ASTMangler::mangleDeclAsUSR(swift::ValueDecl const*, llvm::StringRef)"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
enum a<b{ protocol c{ class d{ class f<b let e=f #^^#
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"complete","original":"098f0ede","signature":"swift::ide::CodeCompletionStringBuilder::addTypeAnnotation(swift::Type, swift::DeclContext const*, swift::GenericSignature)","signatureAssert":"Assertion failed: (genericFuncType->getGenericSignature()->isEqual(genericSig) && \"if not, just use the GFT's signature instead below\"), function eraseArchetypes"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
enum a<b> {
4+
c=d#^^# macro d()
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"complete","original":"a4349038","signature":"(anonymous namespace)::TypeResolver::resolveTupleType(swift::TupleTypeRepr*, swift::TypeResolutionOptions)","signatureAssert":"Assertion failed: (!type->hasTypeParameter() && \"no generic environment provided for type with type parameters\"), function mapTypeIntoContext"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
func a<b > -> () [ {
4+
var : (b) #^^#
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// {"kind":"typecheck","signature":"swift::constraints::TypeVarRefCollector::walkToStmtPre(swift::Stmt*)","signatureAssert":"Assertion failed: (result), function getClosureType"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
@propertyWrapper struct a<b {
4+
wrappedValue: b
5+
}
6+
func c( Bool)d {
7+
@a var e: Bool? =
8+
if .random() {
9+
return
10+
} else {
11+
true
12+
}
13+
c(e
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// {"kind":"typecheck","original":"b8967a13","signature":"(anonymous namespace)::ActorIsolationChecker::checkLocalCaptures(swift::AnyFunctionRef)","signatureAssert":"Assertion failed: (Captures.hasBeenComputed()), function getCaptureInfo"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
func a() {
4+
extension <#type#> {
5+
var b = {
6+
}
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// {"kind":"typecheck","original":"4dcd6877","signature":"swift::Parser::parseStmtForEach(swift::LabeledStmtInfo)","signatureAssert":"Assertion failed: (InBindingPattern == PatternBindingState::NotInBinding && \"for-each loops cannot exist inside other patterns\"), function parseStmtForEach"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
guard
4+
let if <#expression#> {
5+
for <#pattern#> in <#expression#> {
6+
}
7+
} else {
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// {"kind":"typecheck","signature":"swift::constraints::TypeVarRefCollector::walkToStmtPre(swift::Stmt*)","signatureAssert":"Assertion failed: (result), function getClosureType"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
{
4+
lazy var a =
5+
if <#expression#> {
6+
return
7+
}
8+
a
9+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"typecheck","original":"f7872afc","signature":"swift::ParamDecl::setTypeCheckedDefaultExpr(swift::Expr*)","signatureAssert":"Assertion failed: (E || getDefaultArgumentKind() == DefaultArgumentKind::Inherited), function setTypeCheckedDefaultExpr"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
struct a {
4+
init<b>(b = a(

0 commit comments

Comments
 (0)