diff --git a/test/Interop/C/swiftify-import/import-as-instance-method.swift b/test/Interop/C/swiftify-import/import-as-instance-method.swift index 577cf7f122fbe..2360574e7fb3f 100644 --- a/test/Interop/C/swiftify-import/import-as-instance-method.swift +++ b/test/Interop/C/swiftify-import/import-as-instance-method.swift @@ -10,7 +10,7 @@ //--- test.swift import Instance -@available(macOS 13.3.0, *) +@available(SwiftStdlib 5.8, *) func foo(_ p: inout MutableSpan, a: A, aa: inout A, c: C, b: B, bb: inout B) { aa.basic(&p) aa.bar(&p) diff --git a/validation-test/IDE/crashers/0dfb0607ca6550ec.swift b/validation-test/IDE/crashers/0dfb0607ca6550ec.swift new file mode 100644 index 0000000000000..c78c7e07cde8e --- /dev/null +++ b/validation-test/IDE/crashers/0dfb0607ca6550ec.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"002a4f4b","signature":"swift::PrintingDiagnosticConsumer::printDiagnostic(swift::SourceManager&, swift::DiagnosticInfo const&)","signatureAssert":"Assertion failed: ((size_t)sys::locale::columnWidth(Fixit.getText()) == Fixit.getText().size()), function buildFixItLine"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +func b>(a: <#type#>) diff --git a/validation-test/IDE/crashers/113aa5cad622a515.swift b/validation-test/IDE/crashers/113aa5cad622a515.swift new file mode 100644 index 0000000000000..345d98b74452d --- /dev/null +++ b/validation-test/IDE/crashers/113aa5cad622a515.swift @@ -0,0 +1,9 @@ +// {"kind":"complete","original":"3a7f38eb","signature":"swift::Mangle::ASTMangler::appendType(swift::Type, swift::GenericSignature, swift::ValueDecl const*)","signatureAssert":"Assertion failed: (paramTy->isCanonical() && \"cannot mangle non-canonical generic parameter\"), function appendType"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +class a { + func + c() + { + #^^# + } +} diff --git a/validation-test/IDE/crashers/1a97a715994667ab.swift b/validation-test/IDE/crashers/1a97a715994667ab.swift new file mode 100644 index 0000000000000..a8b10f008bb19 --- /dev/null +++ b/validation-test/IDE/crashers/1a97a715994667ab.swift @@ -0,0 +1,9 @@ +// {"kind":"complete","original":"2d0bf5d7","signature":"swift::constraints::ConstraintSystem::getTypeOfReferencePre(swift::constraints::OverloadChoice, swift::DeclContext*, swift::constraints::ConstraintLocatorBuilder, swift::constraints::PreparedOverloadBuilder*)","signatureAssert":"Assertion failed: (!valueType->hasUnboundGenericType() && !valueType->hasTypeParameter()), function getTypeOfReferencePre"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +{ (a: Dictionary) in + #^^# + let b = a { + b + } + let b +} diff --git a/validation-test/IDE/crashers/1c86dd91fb8483fc.swift b/validation-test/IDE/crashers/1c86dd91fb8483fc.swift new file mode 100644 index 0000000000000..edbedf789db26 --- /dev/null +++ b/validation-test/IDE/crashers/1c86dd91fb8483fc.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"070481b6","signature":"swift::Mangle::ASTMangler::appendEntity(swift::ValueDecl const*)","signatureAssert":"Assertion failed: (!isa(decl)), function appendEntity"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +@abi( init () ) func a +#^^#() diff --git a/validation-test/IDE/crashers/1e4621d80984121a.swift b/validation-test/IDE/crashers/1e4621d80984121a.swift new file mode 100644 index 0000000000000..54e28f76afc3d --- /dev/null +++ b/validation-test/IDE/crashers/1e4621d80984121a.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"3a52f860","signature":"swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*)","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 +extension Sequence where a == b [ { func c { map#^^# diff --git a/validation-test/IDE/crashers/32fa0d633e8df376.swift b/validation-test/IDE/crashers/32fa0d633e8df376.swift new file mode 100644 index 0000000000000..cf8957d54f020 --- /dev/null +++ b/validation-test/IDE/crashers/32fa0d633e8df376.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"95ab8e45","signature":"(anonymous namespace)::TypeResolver::resolveVarargType(swift::VarargTypeRepr*, 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 +struct a#^^# diff --git a/validation-test/IDE/crashers/39b75bd7c88ae4eb.swift b/validation-test/IDE/crashers/39b75bd7c88ae4eb.swift new file mode 100644 index 0000000000000..ebb05e8962c32 --- /dev/null +++ b/validation-test/IDE/crashers/39b75bd7c88ae4eb.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"2b4a2fce","signature":"swift::constraints::ConstraintSystem::setClosureType(swift::ClosureExpr const*, swift::FunctionType*)","signatureAssert":"Assertion failed: (type), function setClosureType"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +a( + #^^# { + ( ()) in diff --git a/validation-test/IDE/crashers/39e1947ce3bd2206.swift b/validation-test/IDE/crashers/39e1947ce3bd2206.swift new file mode 100644 index 0000000000000..95cf7da0ab7bb --- /dev/null +++ b/validation-test/IDE/crashers/39e1947ce3bd2206.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"2e29372e","signature":"swift::FragileFunctionKindRequest::evaluate(swift::Evaluator&, swift::DeclContext*) const","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 +if {case ( = { enum a { +#^^# diff --git a/validation-test/IDE/crashers/43a52bf91ab5d2ee.swift b/validation-test/IDE/crashers/43a52bf91ab5d2ee.swift new file mode 100644 index 0000000000000..e0bed6f716ce1 --- /dev/null +++ b/validation-test/IDE/crashers/43a52bf91ab5d2ee.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"2c0990ef","signature":"swift::TypeDecl::getName() const","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 +extension { + a = b [ c [ #^^# diff --git a/validation-test/IDE/crashers/724e28836dc20ecb.swift b/validation-test/IDE/crashers/724e28836dc20ecb.swift new file mode 100644 index 0000000000000..80c4c990ea417 --- /dev/null +++ b/validation-test/IDE/crashers/724e28836dc20ecb.swift @@ -0,0 +1,8 @@ +// {"kind":"complete","original":"b09ce71a","signature":"swift::Decl::getResolvedCustomAttrType(swift::CustomAttr*) const","signatureAssert":"Assertion failed: (ctx.Diags.hadAnyError()), function evaluate","useSourceOrderCompletion":true} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-order-completion -source-filename %s +struct a(swift::Stmt*&)","signatureAssert":"Assertion failed: (size() >= N && \"Dropping more elements than exist\"), function drop_front"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s let:{ let a= #^COMPLETE^#{ b:{ diff --git a/validation-test/IDE/crashers/87443a182257da1e.swift b/validation-test/IDE/crashers/87443a182257da1e.swift new file mode 100644 index 0000000000000..6bc1c60b9935b --- /dev/null +++ b/validation-test/IDE/crashers/87443a182257da1e.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"bf3927a1","signature":"swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*)","signatureAssert":"Assertion failed: (isValid() && \"Can't advance an invalid location\"), function getAdvancedLoc"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +postfix operator %% +postfix func % (a) +func b c b #^^# diff --git a/validation-test/IDE/crashers/88987db0d0dc470c.swift b/validation-test/IDE/crashers/88987db0d0dc470c.swift new file mode 100644 index 0000000000000..e97e9f3c9ad80 --- /dev/null +++ b/validation-test/IDE/crashers/88987db0d0dc470c.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"092969d1","signature":"swift::ide::IDEInspectionInstance::performCachedOperationIfPossible(llvm::hash_code, llvm::IntrusiveRefCntPtr, swift::SearchPathOptions const&, llvm::MemoryBuffer*, unsigned int, swift::DiagnosticConsumer*, std::__1::shared_ptr>, llvm::function_ref)>)","signatureAssert":"Assertion failed: (reparsedInfo.Kind == newInfo.Kind), function performCachedOperationIfPossible","useSourceOrderCompletion":true} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-order-completion -source-filename %s +#^^# @ +#^a^# b diff --git a/validation-test/IDE/crashers/974abc9e171ad368.swift b/validation-test/IDE/crashers/974abc9e171ad368.swift new file mode 100644 index 0000000000000..27eec93a624ef --- /dev/null +++ b/validation-test/IDE/crashers/974abc9e171ad368.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"e6459edc","signature":"swift::TypeChecker::typeCheckStmtConditionElement(swift::StmtConditionElement&, bool&, swift::DeclContext*)","signatureAssert":"Assertion failed: (!E->getType() && \"the bool condition is already type checked\"), function typeCheckBooleanStmtConditionElement"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +(if) {}#^^# diff --git a/validation-test/IDE/crashers/99e962b241f1d25b.swift b/validation-test/IDE/crashers/99e962b241f1d25b.swift new file mode 100644 index 0000000000000..5ba3fa642823e --- /dev/null +++ b/validation-test/IDE/crashers/99e962b241f1d25b.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"10b7f522","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 +if{ extension{ a{ #^^##^b^# diff --git a/validation-test/IDE/crashers/9fefcf40293db48f.swift b/validation-test/IDE/crashers/9fefcf40293db48f.swift new file mode 100644 index 0000000000000..37f9c3ae66541 --- /dev/null +++ b/validation-test/IDE/crashers/9fefcf40293db48f.swift @@ -0,0 +1,6 @@ +// {"kind":"complete","original":"2ab8a74a","signature":"swift::TypeDecl::getName() const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +extension { + subscript -> a { + @ + #^^# diff --git a/validation-test/IDE/crashers/ab3972c8c6c1b5d6.swift b/validation-test/IDE/crashers/ab3972c8c6c1b5d6.swift new file mode 100644 index 0000000000000..a835ccd251123 --- /dev/null +++ b/validation-test/IDE/crashers/ab3972c8c6c1b5d6.swift @@ -0,0 +1,6 @@ +// {"kind":"complete","original":"5070984e","signature":"swift::Decl::getResolvedCustomAttrType(swift::CustomAttr*) const","signatureAssert":"Assertion failed: ((range.isValid()) && \"scope has invalid source range\"), function getCharSourceRangeOfScope"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +@a var b { + @#^^#< #declaration + #> +} diff --git a/validation-test/IDE/crashers/ae7830cc768ad130.swift b/validation-test/IDE/crashers/ae7830cc768ad130.swift new file mode 100644 index 0000000000000..5859728896be5 --- /dev/null +++ b/validation-test/IDE/crashers/ae7830cc768ad130.swift @@ -0,0 +1,8 @@ +// {"kind":"complete","original":"0715e0e8","signature":"swift::Decl::getSemanticAvailableAttr(swift::AvailableAttr const*) const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +class a { + @available(*, renamed: "request0") + ! + b ,() {} +} +#^^# diff --git a/validation-test/IDE/crashers/b74734c97bb09b60.swift b/validation-test/IDE/crashers/b74734c97bb09b60.swift new file mode 100644 index 0000000000000..35af03df2c8ec --- /dev/null +++ b/validation-test/IDE/crashers/b74734c97bb09b60.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","original":"0cd48ae7","signature":"swift::TypeBase::getReducedShape()","signatureAssert":"Assertion failed: (!isTypeVariableOrMember()), function getReducedShape"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +struct a, llvm::DenseSet>, 0u> const&)","signatureAssert":"Assertion failed: (false && \"Should be exhaustive\"), function checkForPotentialCycle"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +struct a : RandomAccessCollection { class endIndex { b -> Element #^^# diff --git a/validation-test/IDE/crashers/d500691bf5d28bbc.swift b/validation-test/IDE/crashers/d500691bf5d28bbc.swift new file mode 100644 index 0000000000000..c53dbb0f1da61 --- /dev/null +++ b/validation-test/IDE/crashers/d500691bf5d28bbc.swift @@ -0,0 +1,7 @@ +// {"kind":"complete","original":"44c76fac","signature":"bool (anonymous namespace)::StmtChecker::typeCheckStmt(swift::Stmt*&)","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 +protocol a where b == <#type#>[ { + func c() -> Self { + #^^# + } +} diff --git a/validation-test/IDE/crashers/e52359b2767fa879.swift b/validation-test/IDE/crashers/e52359b2767fa879.swift new file mode 100644 index 0000000000000..c050f9ae5964d --- /dev/null +++ b/validation-test/IDE/crashers/e52359b2767fa879.swift @@ -0,0 +1,7 @@ +// {"kind":"complete","original":"108dc1e5","signature":"swift::TypeDecl::getName() 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 +extension { +a { + typealias b = ()? + let c = b?? () + #^^# diff --git a/validation-test/IDE/crashers/eaf1c77e3b7e20c6.swift b/validation-test/IDE/crashers/eaf1c77e3b7e20c6.swift new file mode 100644 index 0000000000000..6f635e25323a4 --- /dev/null +++ b/validation-test/IDE/crashers/eaf1c77e3b7e20c6.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"2aa5adcf","signature":"swift::GenericContext::getGenericSignature() const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +struct a : Collection } +a.Iterator.c #^^# diff --git a/validation-test/IDE/crashers_fixed/a1e970213e6f919d.swift b/validation-test/IDE/crashers_fixed/a1e970213e6f919d.swift new file mode 100644 index 0000000000000..0fef9876f8107 --- /dev/null +++ b/validation-test/IDE/crashers_fixed/a1e970213e6f919d.swift @@ -0,0 +1,7 @@ +// {"kind":"complete","original":"158bd92d","signature":"swift::TypeTransform (swift::TypeBase*)>) const::Transform>::doIt(swift::Type, swift::TypePosition)"} +// RUN: %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +struct a : c protocol d { associatedtype b } +protocol c: d where b: e protocol f { associatedtype g: d associatedtype b} +protocol h: f where g == a protocol i : f protocol e { associatedtype j: i +#^^# +associatedtype k: h where k.b == j.b diff --git a/validation-test/compiler_crashers_2/07e13fbf04cabfe9.swift b/validation-test/compiler_crashers_2/07e13fbf04cabfe9.swift new file mode 100644 index 0000000000000..c6e7d79d71298 --- /dev/null +++ b/validation-test/compiler_crashers_2/07e13fbf04cabfe9.swift @@ -0,0 +1,3 @@ +// {"kind":"typecheck","original":"0052e8e2","signature":"swift::constraints::Solution::getFunctionArgApplyInfo(swift::constraints::ConstraintLocator*) const","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-frontend -typecheck %s +& &<##> diff --git a/validation-test/compiler_crashers_2/0e9a3e1eacb8f98e.swift b/validation-test/compiler_crashers_2/0e9a3e1eacb8f98e.swift new file mode 100644 index 0000000000000..bedc4ba04cb1f --- /dev/null +++ b/validation-test/compiler_crashers_2/0e9a3e1eacb8f98e.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","original":"cbf69c52","signature":"swift::constraints::SolverTrail::~SolverTrail()","signatureAssert":"Assertion failed: (Changes.empty() && \"Trail corrupted\"), function ~SolverTrail"} +// RUN: not --crash %target-swift-frontend -typecheck %s +@propertyWrapper struct a { + init(wrappedValue: a) + var wrappedValue: b +} +struct c { + @a @a var d: Int = 2 +} diff --git a/validation-test/compiler_crashers_2/13d9ae996c92be12.swift b/validation-test/compiler_crashers_2/13d9ae996c92be12.swift new file mode 100644 index 0000000000000..64b73e28973d7 --- /dev/null +++ b/validation-test/compiler_crashers_2/13d9ae996c92be12.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","original":"369523c9","signature":"swift::InFlightSubstitution::substType(swift::SubstitutableType*, unsigned int)","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a { + typealias b = a + extension b { + extension b { + } + } +} diff --git a/validation-test/compiler_crashers_2/1e0e4ce6cf612c7b.swift b/validation-test/compiler_crashers_2/1e0e4ce6cf612c7b.swift new file mode 100644 index 0000000000000..c12ce414ca305 --- /dev/null +++ b/validation-test/compiler_crashers_2/1e0e4ce6cf612c7b.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","signature":"checkRequirementsImpl(llvm::ArrayRef, bool)","signatureAssert":"Assertion failed: (!firstType->hasTypeVariable()), function checkRequirementsImpl"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a d diff --git a/validation-test/compiler_crashers_2/254cc6af0002dea1.swift b/validation-test/compiler_crashers_2/254cc6af0002dea1.swift new file mode 100644 index 0000000000000..83f782bb598d0 --- /dev/null +++ b/validation-test/compiler_crashers_2/254cc6af0002dea1.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","original":"ce7c1d7b","signature":"matchCallArguments(swift::constraints::ConstraintSystem&, swift::FunctionType*, swift::ArgumentList*, llvm::ArrayRef, llvm::ArrayRef, swift::constraints::ConstraintKind, swift::constraints::ConstraintLocatorBuilder, std::__1::optional, llvm::SmallVectorImpl>&)","signatureAssert":"Assertion failed: (param), function matchCallArguments"} +// RUN: not --crash %target-swift-frontend -typecheck %s +func a(c: (repeat each b) -> Void) { + c($c: d) +} diff --git a/validation-test/compiler_crashers_2/298b1482f76558b1.swift b/validation-test/compiler_crashers_2/298b1482f76558b1.swift new file mode 100644 index 0000000000000..807742e285dfc --- /dev/null +++ b/validation-test/compiler_crashers_2/298b1482f76558b1.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","original":"06d6e891","signature":"(anonymous namespace)::ExprRewriter::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocatorBuilder)","signatureAssert":"Assertion failed: (toType && !toType->hasError() && !toType->hasTypeVariableOrPlaceholder()), function coerceToType"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a init(projectedValue: + } + c(@f arg: Int) + func d(e: a) { + c($arg: e diff --git a/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift b/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift index 824cc648f95ee..43d11d74ee65f 100644 --- a/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift +++ b/validation-test/compiler_crashers_2/36e4eac6ff343df0.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::constraints::TypeVarRefCollector::walkToStmtPre(swift::Stmt*)","signatureAssert":"Assertion failed: (result), function getClosureType"} +// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::getClosureType(swift::ClosureExpr const*) const","signatureAssert":"Assertion failed: (result), function getClosureType"} // RUN: not --crash %target-swift-frontend -typecheck %s @propertyWrapper struct a"} +// {"kind":"typecheck","signature":"swift::constraints::FailureDiagnostic::resolveType(swift::Type, bool, bool) const","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"} // RUN: not --crash %target-swift-frontend -typecheck %s enum a { b } { let: diff --git a/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift b/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift new file mode 100644 index 0000000000000..0018f8d87839b --- /dev/null +++ b/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","original":"1e8c9260","signature":"(anonymous namespace)::ExprWalker::walkToExprPost(swift::Expr*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a { +callAsFunction { +\a() diff --git a/validation-test/compiler_crashers_2/43f7a6012f6a255a.swift b/validation-test/compiler_crashers_2/43f7a6012f6a255a.swift new file mode 100644 index 0000000000000..dd33a021612a2 --- /dev/null +++ b/validation-test/compiler_crashers_2/43f7a6012f6a255a.swift @@ -0,0 +1,7 @@ +// {"kind":"emit-ir","original":"493cc9db","signature":"(anonymous namespace)::TypeContextDescriptorBuilderBase<(anonymous namespace)::StructContextDescriptorBuilder, swift::StructDecl>::emit()"} +// RUN: not --crash %target-swift-frontend -emit-ir %s +class a { +} +@available(SwiftStdlib 6.2, *) +struct c, e> { +} diff --git a/validation-test/compiler_crashers_2/45fab60ba6296372.swift b/validation-test/compiler_crashers_2/45fab60ba6296372.swift new file mode 100644 index 0000000000000..ef7e8f5b02c57 --- /dev/null +++ b/validation-test/compiler_crashers_2/45fab60ba6296372.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"d550fd71","signature":"diagSyntacticUseRestrictions(swift::Expr const*, swift::DeclContext const*, bool)::DiagnoseWalker::walkToExprPre(swift::Expr*)","signatureAssert":"Assertion failed: (detail::isPresent(Val) && \"dyn_cast on a non-existent value\"), function dyn_cast"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + @<#type#> + #a([ + &(b = 0) + ]) +} diff --git a/validation-test/compiler_crashers_2/50b7d05928ee8b0e.swift b/validation-test/compiler_crashers_2/50b7d05928ee8b0e.swift new file mode 100644 index 0000000000000..5c0b3fe59fc2f --- /dev/null +++ b/validation-test/compiler_crashers_2/50b7d05928ee8b0e.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"7f0c85e8","signature":"diagSyntacticUseRestrictions(swift::Expr const*, swift::DeclContext const*, bool)::DiagnoseWalker::walkToExprPre(swift::Expr*)","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"} +// RUN: not --crash %target-swift-frontend -typecheck %s +class a: ExpressibleByDictionaryLiteral { + typealias Key = b + typealias Value = c + func d(a ) { + { + d(["": 2 diff --git a/validation-test/compiler_crashers_2/56777ed1a15575c4.swift b/validation-test/compiler_crashers_2/56777ed1a15575c4.swift new file mode 100644 index 0000000000000..d89753504936f --- /dev/null +++ b/validation-test/compiler_crashers_2/56777ed1a15575c4.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"bb182de2","signature":"swift::constraints::ConstraintSystem::simplifyKeyPathConstraint(swift::Type, swift::Type, swift::Type, llvm::ArrayRef, swift::optionset::OptionSet, swift::constraints::ConstraintLocatorBuilder)","signatureAssert":"Assertion failed: (contextualRootTy && contextualValueTy), function operator()"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a < each b > { + var + c : (repeat each b) { + (repeat \ .) + } +} diff --git a/validation-test/compiler_crashers_2/6e4c01d8fc888909.swift b/validation-test/compiler_crashers_2/6e4c01d8fc888909.swift new file mode 100644 index 0000000000000..6b031944cb24d --- /dev/null +++ b/validation-test/compiler_crashers_2/6e4c01d8fc888909.swift @@ -0,0 +1,3 @@ +// {"kind":"typecheck","original":"58cef9f3","signature":"swift::Parser::parseTypeInlineArray(swift::SourceLoc)","signatureAssert":"Assertion failed: (getPtrOrNull() && \"not checked for nullptr\"), function get"} +// RUN: not --crash %target-swift-frontend -typecheck %s +[[3] of diff --git a/validation-test/compiler_crashers_2/7498c8f669ed545b.swift b/validation-test/compiler_crashers_2/7498c8f669ed545b.swift new file mode 100644 index 0000000000000..d06560a11d7c2 --- /dev/null +++ b/validation-test/compiler_crashers_2/7498c8f669ed545b.swift @@ -0,0 +1,6 @@ +// {"kind":"typecheck","original":"18b55723","signature":"swift::constraints::Solution::getFunctionArgApplyInfo(swift::constraints::ConstraintLocator*) const","signatureAssert":"Assertion failed: (Val && \"isa<> used on a null pointer\"), function doit"} +// RUN: not --crash %target-swift-frontend -typecheck %s +// REQUIRES: OS=macosx +import Foundation +func a( CGFloat, CGFloat?) +a((1.0: ( diff --git a/validation-test/compiler_crashers_2/8bd36ffa67067b41.swift b/validation-test/compiler_crashers_2/8bd36ffa67067b41.swift new file mode 100644 index 0000000000000..6b9b5b756ade6 --- /dev/null +++ b/validation-test/compiler_crashers_2/8bd36ffa67067b41.swift @@ -0,0 +1,6 @@ +// {"kind":"typecheck","original":"07ee747b","signature":"swift::Type llvm::function_ref::callback_fn(long, swift::SubstitutableType*)","signatureAssert":"Assertion failed: (!elementEnv || elementEnv == archetype->getGenericEnvironment()), function operator()"} +// RUN: not --crash %target-swift-frontend -typecheck %s +func a(c: (repeat each b) -> Void) -> (repeat each b) { + { before, each in + c(repeat before + repeat each diff --git a/validation-test/compiler_crashers_2/9010fe24c9dc7272.swift b/validation-test/compiler_crashers_2/9010fe24c9dc7272.swift new file mode 100644 index 0000000000000..4c9a200f40fd7 --- /dev/null +++ b/validation-test/compiler_crashers_2/9010fe24c9dc7272.swift @@ -0,0 +1,4 @@ +// {"kind":"typecheck","original":"1c912312","signature":"(anonymous namespace)::ExprRewriter::coerceCallArguments(swift::ArgumentList*, swift::AnyFunctionType*, swift::ConcreteDeclRef, swift::ApplyExpr*, swift::constraints::ConstraintLocatorBuilder, llvm::ArrayRef)","signatureAssert":"Assertion failed: (!param.isInOut()), function coerceCallArguments"} +// RUN: not --crash %target-swift-frontend -typecheck %s +func a( inout UnsafeMutableRawPointer...) +a( diff --git a/validation-test/compiler_crashers_2/922c2062e63d9bad.swift b/validation-test/compiler_crashers_2/922c2062e63d9bad.swift new file mode 100644 index 0000000000000..fcfac1a4190ee --- /dev/null +++ b/validation-test/compiler_crashers_2/922c2062e63d9bad.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","original":"65735e17","signature":"swift::Decl::getResolvedCustomAttrType(swift::CustomAttr*) const","signatureAssert":"Assertion failed: (!canType->hasUnboundGenericType()), function computeInvertibleConformances"} +// RUN: not --crash %target-swift-frontend -typecheck %s +@propertyWrapper struct a&)","signatureAssert":"Assertion failed: (!empty()), function front"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a throw withThrowingTaskGroup(of : a) { +b in diff --git a/validation-test/compiler_crashers_2/a23d151072660954.swift b/validation-test/compiler_crashers_2/a23d151072660954.swift new file mode 100644 index 0000000000000..db00ff4df0480 --- /dev/null +++ b/validation-test/compiler_crashers_2/a23d151072660954.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","signature":"checkRequirementsImpl(llvm::ArrayRef, bool)","signatureAssert":"Assertion failed: (!firstType->hasTypeVariable()), function checkRequirementsImpl"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a d)#> diff --git a/validation-test/compiler_crashers_2/a4aba8624dca192d.swift b/validation-test/compiler_crashers_2/a4aba8624dca192d.swift new file mode 100644 index 0000000000000..b428744150f2c --- /dev/null +++ b/validation-test/compiler_crashers_2/a4aba8624dca192d.swift @@ -0,0 +1,3 @@ +// {"kind":"typecheck","original":"c03f63d6","signature":"swift::TypeChecker::typeCheckParameterDefault(swift::Expr*&, swift::DeclContext*, swift::Type, bool, bool)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +func a(repeat each b -> each c = { diff --git a/validation-test/compiler_crashers_2/a8ea3386fbf9c28e.swift b/validation-test/compiler_crashers_2/a8ea3386fbf9c28e.swift new file mode 100644 index 0000000000000..6a8d1dcd7370b --- /dev/null +++ b/validation-test/compiler_crashers_2/a8ea3386fbf9c28e.swift @@ -0,0 +1,6 @@ +// {"kind":"typecheck","signature":"swift::Type llvm::function_ref::callback_fn(long, swift::SubstitutableType*)","signatureAssert":"Assertion failed: (!elementEnv || elementEnv == archetype->getGenericEnvironment()), function operator()"} +// RUN: not --crash %target-swift-frontend -typecheck %s +func a(d: repeat each b e: repeat each c) { + for f repeat each e { + repeat (d + f diff --git a/validation-test/compiler_crashers_2/b9f0fa4bd40b5ec8.swift b/validation-test/compiler_crashers_2/b9f0fa4bd40b5ec8.swift new file mode 100644 index 0000000000000..9a4fe5cbdb0b3 --- /dev/null +++ b/validation-test/compiler_crashers_2/b9f0fa4bd40b5ec8.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"77effdcf","signature":"swift::TypeBase::getSuperclassForDecl(swift::ClassDecl const*, bool)","signatureAssert":"Assertion failed: (isa(nominalDecl) && \"expected a class here\"), function getSuperclassForDecl"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a: b + protocol c { + associatedtype d + } + class b: c + struct e: a { f: d diff --git a/validation-test/compiler_crashers_2/bf28fe4f10fb3d0c.swift b/validation-test/compiler_crashers_2/bf28fe4f10fb3d0c.swift index 2ffd7a95be8af..32aa24893253d 100644 --- a/validation-test/compiler_crashers_2/bf28fe4f10fb3d0c.swift +++ b/validation-test/compiler_crashers_2/bf28fe4f10fb3d0c.swift @@ -1,3 +1,3 @@ -// {"kind":"typecheck","signature":"(anonymous namespace)::ResolvePattern::visitCallExpr(swift::CallExpr*)","signatureAssert":"Assertion failed: (!args->hasAnyInOutArgs()), function composeTupleOrParenPattern"} +// {"kind":"typecheck","signature":"(anonymous namespace)::ResolvePattern::composeTupleOrParenPattern(swift::ArgumentList*)","signatureAssert":"Assertion failed: (!args->hasAnyInOutArgs()), function composeTupleOrParenPattern"} // RUN: not --crash %target-swift-frontend -typecheck %s switch { case .a(&b diff --git a/validation-test/compiler_crashers_2/c2a5da313080f9bb.swift b/validation-test/compiler_crashers_2/c2a5da313080f9bb.swift new file mode 100644 index 0000000000000..a452b0f8ed428 --- /dev/null +++ b/validation-test/compiler_crashers_2/c2a5da313080f9bb.swift @@ -0,0 +1,15 @@ +// {"kind":"typecheck","original":"5c733d48","signature":"getTypeForSymbolRange(swift::rewriting::Symbol const*, swift::rewriting::Symbol const*, llvm::ArrayRef, swift::rewriting::PropertyMap const&)","signatureAssert":"Assertion failed: (std::find(conformsTo.begin(), conformsTo.end(), symbol.getProtocol()) != conformsTo.end()), function getTypeForSymbolRange"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a { + associatedtype b +} +protocol c { + associatedtype b + var d : b + struct e : c { +d : some a struct f < b : a where b == e.b, g == b.b, h == b > { + func + i < b>() + } + } +} diff --git a/validation-test/compiler_crashers_2/dc5f0791705b1cca.swift b/validation-test/compiler_crashers_2/dc5f0791705b1cca.swift index 47eda69e3d76b..9ebe731aea572 100644 --- a/validation-test/compiler_crashers_2/dc5f0791705b1cca.swift +++ b/validation-test/compiler_crashers_2/dc5f0791705b1cca.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::constraints::TypeVarRefCollector::walkToStmtPre(swift::Stmt*)","signatureAssert":"Assertion failed: (result), function getClosureType"} +// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::getClosureType(swift::ClosureExpr const*) const","signatureAssert":"Assertion failed: (result), function getClosureType"} // RUN: not --crash %target-swift-frontend -typecheck %s { lazy var a = diff --git a/validation-test/compiler_crashers_2/eb83d35f4efc1200.swift b/validation-test/compiler_crashers_2/eb83d35f4efc1200.swift new file mode 100644 index 0000000000000..a86934961abc5 --- /dev/null +++ b/validation-test/compiler_crashers_2/eb83d35f4efc1200.swift @@ -0,0 +1,4 @@ +// {"kind":"typecheck","original":"ada65d78","signature":"swift::rewriting::PropertyBag::getAssociatedType(swift::Identifier)","signatureAssert":"Assertion failed: (assocType != nullptr && \"Need to look harder\"), function getAssociatedType"} +// RUN: not --crash %target-swift-frontend -typecheck %s +a +protocol b: RangeReplaceableCollection & a :class a: b diff --git a/validation-test/compiler_crashers_2/ef678247b5bec562.swift b/validation-test/compiler_crashers_2/ef678247b5bec562.swift new file mode 100644 index 0000000000000..f35f9e561a5e6 --- /dev/null +++ b/validation-test/compiler_crashers_2/ef678247b5bec562.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"4d90fbe2","signature":"swift::constraints::AllowTypeOrInstanceMemberFailure::diagnoseAsError()","signatureAssert":"Assertion failed: (TypeDC->getContextKind() == DeclContextKind::AbstractFunctionDecl && \"Expected function decl context for initializer!\"), function diagnoseAsError","splits":[0]} +// RUN: %empty-directory(%t) +// RUN: split-file %s %t +// RUN: not --crash %target-swift-frontend -typecheck %t/main.swift %t/x1.swift +//--- main.swift + +//--- x1.swift +let <#pattern#>: LazyMapCollection = .lazy diff --git a/validation-test/compiler_crashers_2/f795c2f5f8d23312.swift b/validation-test/compiler_crashers_2/f795c2f5f8d23312.swift new file mode 100644 index 0000000000000..eca245fb9e824 --- /dev/null +++ b/validation-test/compiler_crashers_2/f795c2f5f8d23312.swift @@ -0,0 +1,7 @@ +// {"kind":"typecheck","original":"c950cc2e","signature":"(anonymous namespace)::MultiConformanceChecker::checkAllConformances()","signatureAssert":"Assertion failed: (!type->hasTypeParameter() && \"no generic environment provided for type with type parameters\"), function mapTypeIntoContext"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a, bool)","signatureAssert":"Assertion failed: (!firstType->hasTypeVariable()), function checkRequirementsImpl"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a"} +// RUN: not --crash %target-swift-frontend -emit-silgen %s +@propertyWrapper struct a { + init(wrappedValue: b...) { + } + var wrappedValue: b +} +class c { + @a var d = 2 +} diff --git a/validation-test/compiler_crashers_2_fixed/8879748097cd16db.swift b/validation-test/compiler_crashers_2_fixed/8879748097cd16db.swift new file mode 100644 index 0000000000000..62fde04c4c388 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/8879748097cd16db.swift @@ -0,0 +1,10 @@ +// {"kind":"typecheck","original":"16ab065c","signature":"swift::rewriting::RequirementMachine::checkCompletionResult(swift::rewriting::CompletionResult) const"} +// RUN: not %target-swift-frontend -typecheck %s +protocol a: b + protocol b { + associatedtype c + } + protocol d: e, + f + protocol f: b where c: f + protocol e: a where c: e