From 19b16a5b6dc1a5059c65668cade473fe7cfe5240 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 1 Sep 2025 09:28:55 +0100 Subject: [PATCH 1/2] [test] Update a couple of crasher signatures --- validation-test/IDE/crashers/276e1958e5b2f36f.swift | 2 +- validation-test/IDE/crashers/9a6a167b9c9fe2e.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/validation-test/IDE/crashers/276e1958e5b2f36f.swift b/validation-test/IDE/crashers/276e1958e5b2f36f.swift index 2611e7a7a9065..76c140c2faf9c 100644 --- a/validation-test/IDE/crashers/276e1958e5b2f36f.swift +++ b/validation-test/IDE/crashers/276e1958e5b2f36f.swift @@ -1,4 +1,4 @@ -// {"kind":"complete","original":"14893775","signature":"swift::TypeResolution::resolveContextualType(swift::TypeRepr*, swift::DeclContext*, swift::GenericSignature, swift::TypeResolutionOptions, llvm::function_ref, llvm::function_ref, llvm::function_ref, swift::SILTypeResolutionContext*)","signatureAssert":"Assertion failed: (!type->hasTypeParameter() && \"no generic environment provided for type with type parameters\"), function mapTypeIntoContext"} +// {"kind":"complete","original":"14893775","signature":"swift::TypeResolution::resolveContextualType(swift::TypeRepr*, swift::DeclContext*, swift::GenericSignature, swift::TypeResolutionOptions, llvm::function_ref, llvm::function_ref, llvm::function_ref, llvm::function_ref)>, swift::SILTypeResolutionContext*)","signatureAssert":"Assertion failed: (!type->hasTypeParameter() && \"no generic environment provided for type with type parameters\"), function mapTypeIntoContext"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s @a( #^^#) func b() diff --git a/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift b/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift index c0413bf285c8f..98d8f68a027f4 100644 --- a/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift +++ b/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift @@ -1,4 +1,4 @@ -// {"kind":"complete","signature":"swift::ide::CompletionLookup::addCallArgumentPatterns(swift::ide::CodeCompletionResultBuilder&, llvm::ArrayRef, llvm::ArrayRef, swift::GenericSignature, bool)","signatureAssert":"Assertion failed: (declParams.empty() || typeParams.size() == declParams.size()), function addCallArgumentPatterns"} +// {"kind":"complete","signature":"swift::ide::CodeCompletionStringBuilder::addCallArgumentPatterns(llvm::ArrayRef, llvm::ArrayRef, swift::DeclContext const*, swift::GenericSignature, bool)","signatureAssert":"Assertion failed: (declParams.empty() || typeParams.size() == declParams.size()), function addCallArgumentPatterns"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s func a( repeat each b)c == a( #^COMPLETE^# d From 1f0d22807cc9bcf00f9b7e1a62bce0335b51a4f6 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Mon, 1 Sep 2025 09:28:55 +0100 Subject: [PATCH 2/2] [test] Add some more known crashers --- validation-test/IDE/crashers/16a3fafef684fb37.swift | 5 +++++ validation-test/IDE/crashers/2ac01e9917bfde5.swift | 4 ++++ validation-test/IDE/crashers/796ef3e298a05a47.swift | 5 +++++ validation-test/IDE/crashers/cfad4ec3ad706bac.swift | 5 +++++ .../compiler_crashers_2/0208-issue-51259.swift | 1 + .../compiler_crashers_2/298c18942254d677.swift | 8 ++++++++ .../compiler_crashers_2/2e9f8c21a3644ca9.swift | 5 +++++ validation-test/compiler_crashers_2/56561b79b963bc.swift | 7 +++++++ .../compiler_crashers_2/c8788f7208dff60.swift | 3 +++ .../compiler_crashers_2/c956e03382cbc94.swift | 9 +++++++++ .../compiler_crashers_2/d0221822dccb4124.swift | 6 ++++++ .../compiler_crashers_2/df1e71cd8c428eba.swift | 6 ++++++ 12 files changed, 64 insertions(+) create mode 100644 validation-test/IDE/crashers/16a3fafef684fb37.swift create mode 100644 validation-test/IDE/crashers/2ac01e9917bfde5.swift create mode 100644 validation-test/IDE/crashers/796ef3e298a05a47.swift create mode 100644 validation-test/IDE/crashers/cfad4ec3ad706bac.swift create mode 100644 validation-test/compiler_crashers_2/298c18942254d677.swift create mode 100644 validation-test/compiler_crashers_2/2e9f8c21a3644ca9.swift create mode 100644 validation-test/compiler_crashers_2/56561b79b963bc.swift create mode 100644 validation-test/compiler_crashers_2/c8788f7208dff60.swift create mode 100644 validation-test/compiler_crashers_2/c956e03382cbc94.swift create mode 100644 validation-test/compiler_crashers_2/d0221822dccb4124.swift create mode 100644 validation-test/compiler_crashers_2/df1e71cd8c428eba.swift diff --git a/validation-test/IDE/crashers/16a3fafef684fb37.swift b/validation-test/IDE/crashers/16a3fafef684fb37.swift new file mode 100644 index 0000000000000..4975470400104 --- /dev/null +++ b/validation-test/IDE/crashers/16a3fafef684fb37.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"6bce2476","signature":"swift::ide::PostfixCompletionCallback::sawSolutionImpl(swift::constraints::Solution const&)","signatureAssert":"Assertion failed: (BaseIsStaticMetaType == Other.BaseIsStaticMetaType), function tryMerge"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +extension BinaryInteger { +a { .Iterator.Element#^^# == +self diff --git a/validation-test/IDE/crashers/2ac01e9917bfde5.swift b/validation-test/IDE/crashers/2ac01e9917bfde5.swift new file mode 100644 index 0000000000000..947ae8416e966 --- /dev/null +++ b/validation-test/IDE/crashers/2ac01e9917bfde5.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"eb071a3e","signature":"swift::constraints::ConstraintSystem::isArgumentGenericFunction(swift::Type, swift::Expr*)","signatureAssert":"Assertion failed: (!getFixedType(tyvar)), function getUnboundBindOverloadDisjunction"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +func a() -> Sequence +a() + #^^#& diff --git a/validation-test/IDE/crashers/796ef3e298a05a47.swift b/validation-test/IDE/crashers/796ef3e298a05a47.swift new file mode 100644 index 0000000000000..b9839370ef520 --- /dev/null +++ b/validation-test/IDE/crashers/796ef3e298a05a47.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"5d283fee","signature":"swift::TypeRepr::print(swift::ASTPrinter&, swift::PrintOptions const&, swift::optionset::OptionSet) const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +@abi( + extension { #^^#<#declaration#>) + <#declaration#> diff --git a/validation-test/IDE/crashers/cfad4ec3ad706bac.swift b/validation-test/IDE/crashers/cfad4ec3ad706bac.swift new file mode 100644 index 0000000000000..0f8403b6978bd --- /dev/null +++ b/validation-test/IDE/crashers/cfad4ec3ad706bac.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"b353d673","signature":"swift::ide::ArgumentTypeCheckCompletionCallback::sawSolutionImpl(swift::constraints::Solution const&)","signatureAssert":"Assertion failed: (false && \"bad parent call match?\"), function sawSolutionImpl"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +{ + b ? \.a (#^^# +}( diff --git a/validation-test/compiler_crashers_2/0208-issue-51259.swift b/validation-test/compiler_crashers_2/0208-issue-51259.swift index be8a46b6771ac..9187710f7c9d1 100644 --- a/validation-test/compiler_crashers_2/0208-issue-51259.swift +++ b/validation-test/compiler_crashers_2/0208-issue-51259.swift @@ -1,3 +1,4 @@ +// {"kind":"emit-silgen","signature":"swift::Lowering::SILGenModule::useConformance(swift::ProtocolConformanceRef)"} // RUN: not --crash %target-swift-frontend -emit-ir %s // rdar://problem/65571199 // UNSUPPORTED: asan diff --git a/validation-test/compiler_crashers_2/298c18942254d677.swift b/validation-test/compiler_crashers_2/298c18942254d677.swift new file mode 100644 index 0000000000000..2d75e7a11b75b --- /dev/null +++ b/validation-test/compiler_crashers_2/298c18942254d677.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"454af16a","signature":"swift::Mangle::ASTMangler::appendClosureComponents(swift::CanType, unsigned int, bool, swift::DeclContext const*, llvm::ArrayRef)","stackOverflow":true} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol P { +} +{ + return a + func a() -> some P +} diff --git a/validation-test/compiler_crashers_2/2e9f8c21a3644ca9.swift b/validation-test/compiler_crashers_2/2e9f8c21a3644ca9.swift new file mode 100644 index 0000000000000..cc7910ca8af02 --- /dev/null +++ b/validation-test/compiler_crashers_2/2e9f8c21a3644ca9.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","original":"3a7e17d4","signature":"swift::TypeBase::computeInvertibleConformances()","signatureAssert":"Assertion failed: (!canType->hasUnboundGenericType()), function computeInvertibleConformances"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a, swift::constraints::ConstraintLocatorBuilder)","signatureAssert":"Assertion failed: (found != openedOverloadTypes.end()), function simplifyExplicitGenericArgumentsConstraint"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a { + struct b + struct b< a { + struct c.c< > diff --git a/validation-test/compiler_crashers_2/c8788f7208dff60.swift b/validation-test/compiler_crashers_2/c8788f7208dff60.swift new file mode 100644 index 0000000000000..90c97a3ff0cba --- /dev/null +++ b/validation-test/compiler_crashers_2/c8788f7208dff60.swift @@ -0,0 +1,3 @@ +// {"kind":"typecheck","original":"6bb0b020","signature":"swift::KeyPathExpr::getKeyPathType() const","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ let a = \ .b { c} (let c = a diff --git a/validation-test/compiler_crashers_2/c956e03382cbc94.swift b/validation-test/compiler_crashers_2/c956e03382cbc94.swift new file mode 100644 index 0000000000000..3c65a22d943f8 --- /dev/null +++ b/validation-test/compiler_crashers_2/c956e03382cbc94.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","original":"1562769e","signature":"(anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +enum c + func d() e { + if let + f = c + { + switch f { + case let a(b) where b diff --git a/validation-test/compiler_crashers_2/d0221822dccb4124.swift b/validation-test/compiler_crashers_2/d0221822dccb4124.swift new file mode 100644 index 0000000000000..ff33fb075f56d --- /dev/null +++ b/validation-test/compiler_crashers_2/d0221822dccb4124.swift @@ -0,0 +1,6 @@ +// {"kind":"typecheck","original":"00d07d13","signature":"swift::constraints::ConstraintSystem::simplifySameShapeConstraint(swift::Type, swift::Type, swift::optionset::OptionSet, swift::constraints::ConstraintLocatorBuilder)","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a