Skip to content

Commit ecbc70d

Browse files
authored
Merge pull request #83824 from hamishknight/fuzzy
[test] Add some more known crashers
2 parents 9be0598 + 0c29284 commit ecbc70d

14 files changed

+108
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// {"kind":"complete","original":"1a6ddccd","signature":"getRequirementMachine"}
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 c: a
5+
var b: c
6+
}
7+
protocol d: a where c == Never
8+
extension Never: d
9+
extension d {
10+
public( #^^#
11+
b: Never
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// {"kind":"complete","original":"df6ac250","signature":"bool llvm::function_ref<bool (swift::constraints::Constraint*)>::callback_fn<swift::constraints::ConstraintSystem::simplifyAppliedOverloadsImpl(swift::constraints::Constraint*, swift::TypeVariableType*, swift::FunctionType*, unsigned int, swift::constraints::ConstraintLocatorBuilder)::$_2>(long, swift::constraints::Constraint*)","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+
struct a {
4+
b func b()
5+
#if {
6+
b(<#expression#>)
7+
}#^^#
8+
#endif
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// {"kind":"complete","original":"ad5b343d","signature":"swift::InterfaceTypeRequest::cacheResult(swift::Type) const","signatureAssert":"Assertion failed: (!type->is<InOutType>() && \"Interface type must be materializable\"), function cacheResult"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
[
4+
#^^#
5+
].reduce?(
6+
[:][0] {
7+
$a, b in
8+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"complete","original":"6384b7fc","signature":"swift::TypeChecker::typeCheckForCodeCompletion(swift::constraints::SyntacticElementTarget&, bool, llvm::function_ref<void (swift::constraints::Solution const&)>)","signatureAssert":"Assertion failed: (fallback->E != expr), function typeCheckForCodeCompletion"}
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+
a > (c > a #^^# )'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"complete","original":"7f4bcc9e","signature":"swift::DeclContext::getDeclaredInterfaceType() const","signatureAssert":"Assertion failed: (detail::isPresent(Val) && \"dyn_cast on a non-existent value\"), function dyn_cast"}
2+
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
3+
extension Sequence where a == b[ {
4+
func c() -> #^^#
5+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// {"kind":"complete","original":"bae855bf","signature":"swift::GenericSignatureRequest::diagnoseCycle(swift::DiagnosticEngine&) const","signatureAssert":"Assertion failed: (!ActiveDiagnostic && \"Already have an active diagnostic\"), function diagnose"}
1+
// {"kind":"complete","original":"bae855bf","signature":"swift::GenericTypeParamDecl::getSourceRange() const","signatureAssert":"Assertion failed: (Start.isValid() == End.isValid() && \"Start and end should either both be valid or both be invalid!\"), function SourceRange"}
22
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
33
class a<b: c, b extension a where b #^^#
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// {"kind":"emit-silgen","signature":"swift::Lowering::SILGenModule::useConformance(swift::ProtocolConformanceRef)"}
2+
// RUN: not --crash %target-swift-frontend -emit-silgen %s
3+
protocol a {
4+
}
5+
struct b<c: a> {
6+
}
7+
extension [b<Int>] {
8+
func d() {
9+
first
10+
}
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// {"kind":"typecheck","original":"b3234b81","signature":"swift::constraints::ConstraintSystem::recordImpliedResult(swift::Expr*, swift::constraints::ImpliedResultKind)","signatureAssert":"Assertion failed: (inserted && \"Duplicate implied result?\"), function recordImpliedResult"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
[
4+
switch 0 {
5+
case .a(
6+
if <#expression#> {
7+
b
8+
}):
9+
}
10+
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// {"kind":"typecheck","original":"6f23f24c","signature":"diagnoseUnintendedOptionalBehavior(swift::Expr const*, swift::DeclContext const*)::UnintendedOptionalBehaviorWalker::walkToExprPre(swift::Expr*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
{
4+
@<#type#>
5+
#a {
6+
&b
7+
0 as c
8+
}
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// {"kind":"typecheck","original":"96fa6e3e","signature":"swift::StorageImplInfoRequest::evaluate(swift::Evaluator&, swift::AbstractStorageDecl*) const","signatureAssert":"Assertion failed: (info.hasStorage() == storage->hasStorage() || storage->getASTContext().Diags.hadAnyError()), function evaluate"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
class a {
4+
func b() {
5+
override var c: Any {
6+
didSet {
7+
}
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)