From adb40dd82e0dcb61b7c802855d84b917a246fa9d Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Sun, 14 Sep 2025 10:35:53 +0100 Subject: [PATCH 1/2] [test] Update a couple of crasher signatures --- validation-test/IDE/crashers/38a36bbefc496da.swift | 2 +- validation-test/IDE/crashers/524ea7a5cd78074.swift | 2 +- validation-test/IDE/crashers/796ef3e298a05a47.swift | 2 +- validation-test/IDE/crashers/9a6a167b9c9fe2e.swift | 2 +- .../{a79aa9924bdc378.swift => d4b14cb8215713c.swift} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename validation-test/compiler_crashers_2/{a79aa9924bdc378.swift => d4b14cb8215713c.swift} (100%) diff --git a/validation-test/IDE/crashers/38a36bbefc496da.swift b/validation-test/IDE/crashers/38a36bbefc496da.swift index 832e1478b619b..32668edc7cec7 100644 --- a/validation-test/IDE/crashers/38a36bbefc496da.swift +++ b/validation-test/IDE/crashers/38a36bbefc496da.swift @@ -1,4 +1,4 @@ -// {"kind":"complete","original":"61e9155a","signature":"swift::ide::ContextFreeCodeCompletionResult::getCodeCompletionDeclKind(swift::Decl const*)"} +// {"kind":"complete","original":"61e9155a","signature":"swift::ide::CodeCompletionResultBuilder::takeResult()"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s extension () where diff --git a/validation-test/IDE/crashers/524ea7a5cd78074.swift b/validation-test/IDE/crashers/524ea7a5cd78074.swift index 9be45965c5d66..bb2dd5f426f54 100644 --- a/validation-test/IDE/crashers/524ea7a5cd78074.swift +++ b/validation-test/IDE/crashers/524ea7a5cd78074.swift @@ -1,3 +1,3 @@ -// {"kind":"complete","signature":"swift::Mangle::ASTMangler::mangleDeclAsUSR(swift::ValueDecl const*, llvm::StringRef)"} +// {"kind":"complete","signature":"swift::ide::CodeCompletionResultBuilder::takeResult()"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s struct a { extension b { struct c { struct d) const"} +// {"kind":"complete","original":"5d283fee","signature":"swift::TypeRepr::print(swift::ASTPrinter&, swift::PrintOptions const&, swift::optionset::OptionSet) const","signatureAssert":"Assertion failed: (ext->canNeverBeBound() && \"Should have been bound by bindExtensions\"), function evaluate"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s @abi( extension { #^^#<#declaration#>) diff --git a/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift b/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift index 98d8f68a027f4..17677916aeb48 100644 --- a/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift +++ b/validation-test/IDE/crashers/9a6a167b9c9fe2e.swift @@ -1,4 +1,4 @@ -// {"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"} +// {"kind":"complete","signature":"swift::ide::CodeCompletionStringBuilder::addCallArgumentPatterns(llvm::ArrayRef, llvm::ArrayRef, swift::DeclContext const*, swift::GenericSignature, swift::ide::DefaultArgumentOutputMode, 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 diff --git a/validation-test/compiler_crashers_2/a79aa9924bdc378.swift b/validation-test/compiler_crashers_2/d4b14cb8215713c.swift similarity index 100% rename from validation-test/compiler_crashers_2/a79aa9924bdc378.swift rename to validation-test/compiler_crashers_2/d4b14cb8215713c.swift From 6de09e1956a90bfd07fcff9b5685d86f155f161d Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Sun, 14 Sep 2025 10:35:53 +0100 Subject: [PATCH 2/2] [test] Add some more known crashers --- validation-test/IDE/crashers/44e8aa11615df18.swift | 5 +++++ validation-test/IDE/crashers/6e14da1a44c1cdc6.swift | 9 +++++++++ validation-test/IDE/crashers/8b1e4c7f2174671c.swift | 3 +++ validation-test/IDE/crashers/8fb80df278d76cd.swift | 5 +++++ validation-test/IDE/crashers/cdc75ec659bc26a6.swift | 4 ++++ .../compiler_crashers_2/36e4eac6ff343df0.swift | 13 +++++++++++++ .../compiler_crashers_2/40188c379c9ebe45.swift | 8 ++++++++ .../compiler_crashers_2/4059e8d9978c8be6.swift | 8 ++++++++ .../compiler_crashers_2/dc5f791705b1cca.swift | 9 +++++++++ .../compiler_crashers_2_fixed/548d48154de3e7d.swift | 4 ++++ 10 files changed, 68 insertions(+) create mode 100644 validation-test/IDE/crashers/44e8aa11615df18.swift create mode 100644 validation-test/IDE/crashers/6e14da1a44c1cdc6.swift create mode 100644 validation-test/IDE/crashers/8b1e4c7f2174671c.swift create mode 100644 validation-test/IDE/crashers/8fb80df278d76cd.swift create mode 100644 validation-test/IDE/crashers/cdc75ec659bc26a6.swift create mode 100644 validation-test/compiler_crashers_2/36e4eac6ff343df0.swift create mode 100644 validation-test/compiler_crashers_2/40188c379c9ebe45.swift create mode 100644 validation-test/compiler_crashers_2/4059e8d9978c8be6.swift create mode 100644 validation-test/compiler_crashers_2/dc5f791705b1cca.swift create mode 100644 validation-test/compiler_crashers_2_fixed/548d48154de3e7d.swift diff --git a/validation-test/IDE/crashers/44e8aa11615df18.swift b/validation-test/IDE/crashers/44e8aa11615df18.swift new file mode 100644 index 0000000000000..c7c19e72c1f15 --- /dev/null +++ b/validation-test/IDE/crashers/44e8aa11615df18.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"8af9696a","signature":"(anonymous namespace)::TypePrinter::printWithParensIfNotSimple(swift::Type)","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +// REQUIRES: OS=macosx +import Foundation +var a: some NSMutableArray = a == #^^# = <#expression#> diff --git a/validation-test/IDE/crashers/6e14da1a44c1cdc6.swift b/validation-test/IDE/crashers/6e14da1a44c1cdc6.swift new file mode 100644 index 0000000000000..3dfbf9e2e56fd --- /dev/null +++ b/validation-test/IDE/crashers/6e14da1a44c1cdc6.swift @@ -0,0 +1,9 @@ +// {"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[]"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +protocol a { + struct b { + var c: (some Any, Int) { + #^^# + } + } +} diff --git a/validation-test/IDE/crashers/8b1e4c7f2174671c.swift b/validation-test/IDE/crashers/8b1e4c7f2174671c.swift new file mode 100644 index 0000000000000..a8ac615a5ddbe --- /dev/null +++ b/validation-test/IDE/crashers/8b1e4c7f2174671c.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"2201e4ed","signature":"swift::Mangle::ASTMangler::mangleDeclAsUSR(swift::ValueDecl const*, llvm::StringRef)"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +enum agetGenericSignature()->isEqual(genericSig) && \"if not, just use the GFT's signature instead below\"), function eraseArchetypes"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +enum a { + c=d#^^# macro d() +} diff --git a/validation-test/IDE/crashers/cdc75ec659bc26a6.swift b/validation-test/IDE/crashers/cdc75ec659bc26a6.swift new file mode 100644 index 0000000000000..b40c059dbb413 --- /dev/null +++ b/validation-test/IDE/crashers/cdc75ec659bc26a6.swift @@ -0,0 +1,4 @@ +// {"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"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +func a -> () [ { + var : (b) #^^# diff --git a/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift b/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift new file mode 100644 index 0000000000000..824cc648f95ee --- /dev/null +++ b/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift @@ -0,0 +1,13 @@ +// {"kind":"typecheck","signature":"swift::constraints::TypeVarRefCollector::walkToStmtPre(swift::Stmt*)","signatureAssert":"Assertion failed: (result), function getClosureType"} +// RUN: not --crash %target-swift-frontend -typecheck %s +@propertyWrapper struct a { + var b = { + } + } +} diff --git a/validation-test/compiler_crashers_2/4059e8d9978c8be6.swift b/validation-test/compiler_crashers_2/4059e8d9978c8be6.swift new file mode 100644 index 0000000000000..d8e02791c4d1a --- /dev/null +++ b/validation-test/compiler_crashers_2/4059e8d9978c8be6.swift @@ -0,0 +1,8 @@ +// {"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"} +// RUN: not --crash %target-swift-frontend -typecheck %s +guard + let if <#expression#> { + for <#pattern#> in <#expression#> { + } + } else { + } diff --git a/validation-test/compiler_crashers_2/dc5f791705b1cca.swift b/validation-test/compiler_crashers_2/dc5f791705b1cca.swift new file mode 100644 index 0000000000000..47eda69e3d76b --- /dev/null +++ b/validation-test/compiler_crashers_2/dc5f791705b1cca.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","signature":"swift::constraints::TypeVarRefCollector::walkToStmtPre(swift::Stmt*)","signatureAssert":"Assertion failed: (result), function getClosureType"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + lazy var a = + if <#expression#> { + return + } + a +} diff --git a/validation-test/compiler_crashers_2_fixed/548d48154de3e7d.swift b/validation-test/compiler_crashers_2_fixed/548d48154de3e7d.swift new file mode 100644 index 0000000000000..1367e6e745965 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/548d48154de3e7d.swift @@ -0,0 +1,4 @@ +// {"kind":"typecheck","original":"f7872afc","signature":"swift::ParamDecl::setTypeCheckedDefaultExpr(swift::Expr*)","signatureAssert":"Assertion failed: (E || getDefaultArgumentKind() == DefaultArgumentKind::Inherited), function setTypeCheckedDefaultExpr"} +// RUN: not %target-swift-frontend -typecheck %s +struct a { + init(b = a(