diff --git a/validation-test/IDE/crashers/0c2dce70e089243d.swift b/validation-test/IDE/crashers/0c2dce70e089243d.swift new file mode 100644 index 0000000000000..3a6827355bbdf --- /dev/null +++ b/validation-test/IDE/crashers/0c2dce70e089243d.swift @@ -0,0 +1,8 @@ +// {"kind":"complete","signature":"(anonymous namespace)::getEquivalentDeclContextFromSourceFile(swift::DeclContext*, swift::SourceFile*)","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 +// https://github.com/swiftlang/swift/issues/84785 +func 0 { +#^^# +} +do { func a { +#^b^# diff --git a/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift b/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift index ac861aa0e24e9..e33f8e2484798 100644 --- a/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift +++ b/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift @@ -1,4 +1,4 @@ -// {"kind":"complete","signature":"swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*)","signatureAssert":"Assertion failed: (detail::isPresent(Val) && \"dyn_cast on a non-existent value\"), function dyn_cast"} +// {"kind":"complete","signature":"resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*, swift::optionset::OptionSet)","signatureAssert":"Assertion failed: (detail::isPresent(Val) && \"dyn_cast on a non-existent value\"), function dyn_cast"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s extension <#type#> { var diff --git a/validation-test/IDE/crashers/1e4621d80984121a.swift b/validation-test/IDE/crashers/1e4621d80984121a.swift index 54e28f76afc3d..da60e874b6371 100644 --- a/validation-test/IDE/crashers/1e4621d80984121a.swift +++ b/validation-test/IDE/crashers/1e4621d80984121a.swift @@ -1,3 +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"} +// {"kind":"complete","original":"3a52f860","signature":"resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*, swift::optionset::OptionSet)","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/631208e8e9212ebd.swift b/validation-test/IDE/crashers/631208e8e9212ebd.swift new file mode 100644 index 0000000000000..7fcf5a6cba380 --- /dev/null +++ b/validation-test/IDE/crashers/631208e8e9212ebd.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"b8da5db5","signature":"swift::rewriting::RequirementMachine::requiresClass(swift::Type) const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +extension Slice { +a { + #^^# diff --git a/validation-test/IDE/crashers/7621907bdc5958a6.swift b/validation-test/IDE/crashers/7621907bdc5958a6.swift index 90c97bc85ad35..936ceff82a8f3 100644 --- a/validation-test/IDE/crashers/7621907bdc5958a6.swift +++ b/validation-test/IDE/crashers/7621907bdc5958a6.swift @@ -1,4 +1,4 @@ -// {"kind":"complete","original":"526e79b6","signature":"swift::TypeChecker::checkDeclAttributes(swift::Decl*)","signatureAssert":"Assertion failed: (Ctx.hadError()), function visitCustomAttr","useSourceOrderCompletion":true} +// {"kind":"complete","original":"526e79b6","signature":"(anonymous namespace)::AttributeChecker::visitCustomAttr(swift::CustomAttr*)","signatureAssert":"Assertion failed: (Ctx.hadError()), function visitCustomAttr","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 #^^# typealias a = . struct b { diff --git a/validation-test/IDE/crashers/7ee355a338d6ef78.swift b/validation-test/IDE/crashers/7ee355a338d6ef78.swift new file mode 100644 index 0000000000000..3ffc7b5153894 --- /dev/null +++ b/validation-test/IDE/crashers/7ee355a338d6ef78.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"afd4a708","signature":"swift::ClangUSRGenerationRequest::evaluate(swift::Evaluator&, swift::ValueDecl const*) const","signatureAssert":"Assertion failed: (ObjCName.second), function printObjCUSR"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +// REQUIRES: objc_interop +@objc(: @ protocol a +.#^^# diff --git a/validation-test/IDE/crashers/89642f94e4444b17.swift b/validation-test/IDE/crashers/89642f94e4444b17.swift new file mode 100644 index 0000000000000..14b8409f05d05 --- /dev/null +++ b/validation-test/IDE/crashers/89642f94e4444b17.swift @@ -0,0 +1,9 @@ +// {"kind":"complete","original":"dbc80c20","signature":"swift::AbstractStorageDecl::setSynthesizedAccessor(swift::AccessorKind, swift::AccessorDecl*)"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +protocol a { + associatedtype c: a + var b: c +} +protocol d: a where c == Never + extension Never: d + extension d { b: Never = #^^# diff --git a/validation-test/IDE/crashers/93646f990f2e8498.swift b/validation-test/IDE/crashers/93646f990f2e8498.swift index 052a50f670261..f5c3ee165447c 100644 --- a/validation-test/IDE/crashers/93646f990f2e8498.swift +++ b/validation-test/IDE/crashers/93646f990f2e8498.swift @@ -1,4 +1,4 @@ -// {"kind":"complete","original":"ac690622","signature":"swift::rewriting::RequirementMachine::requiresClass(swift::Type) const"} +// {"kind":"complete","original":"ac690622","signature":"swift::rewriting::RequirementMachine::verify(swift::rewriting::MutableTerm const&) const"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s protocol a { associatedtype b diff --git a/validation-test/IDE/crashers/98bd083880c2694d.swift b/validation-test/IDE/crashers/98bd083880c2694d.swift new file mode 100644 index 0000000000000..4aad971f596e2 --- /dev/null +++ b/validation-test/IDE/crashers/98bd083880c2694d.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"54d9bed5","signature":"swift::ClangUSRGenerationRequest::evaluate(swift::Evaluator&, swift::ValueDecl const*) const"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +@ c struct a > +#^^# diff --git a/validation-test/IDE/crashers/b702ab48c2f29a3a.swift b/validation-test/IDE/crashers/b702ab48c2f29a3a.swift index 239d851fae9e5..f1cf4b8a0ce29 100644 --- a/validation-test/IDE/crashers/b702ab48c2f29a3a.swift +++ b/validation-test/IDE/crashers/b702ab48c2f29a3a.swift @@ -1,3 +1,3 @@ -// {"kind":"complete","signature":"swift::rewriting::RequirementMachine::lookupNestedType(swift::Type, swift::Identifier) const"} +// {"kind":"complete","signature":"swift::rewriting::RequirementMachine::verify(swift::rewriting::MutableTerm const&) const"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s class a(swift::Evaluator&, swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType)::'lambda'()>(swift::FragileFunctionKindRequest const&, swift::FragileFunctionKindRequest::OutputType swift::evaluateOrDefault(swift::Evaluator&, swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType)::'lambda'())","signatureAssert":"Assertion failed: (Val && \"isa<> used on a null pointer\"), function doit"} +// {"kind":"complete","signature":"swift::FragileFunctionKindRequest::OutputType swift::Evaluator::getResultUncached(swift::Evaluator&, swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType)::'lambda'()>(swift::FragileFunctionKindRequest const&, swift::FragileFunctionKindRequest::OutputType swift::evaluateOrDefault(swift::Evaluator&, swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType)::'lambda'())::'lambda'()::operator()() const","signatureAssert":"Assertion failed: (Val && \"isa<> used on a null pointer\"), function doit"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s case ( <#expression#>= { enum a : #^COMPLETE^# diff --git a/validation-test/IDE/crashers/e6e38c515da4fe5a.swift b/validation-test/IDE/crashers/e6e38c515da4fe5a.swift new file mode 100644 index 0000000000000..05761ee513350 --- /dev/null +++ b/validation-test/IDE/crashers/e6e38c515da4fe5a.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"afd4a708","signature":"swift::objc_translation::getNameForObjC(swift::ValueDecl const*, swift::objc_translation::CustomNamesOnly_t)","signatureAssert":"Assertion failed: (name->getNumSelectorPieces() == 1), function getNameForObjC"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +// REQUIRES: objc_interop +@objc(:a @ protocol b +.#^^# diff --git a/validation-test/compiler_crashers_2/035fa4d6c659f717.swift b/validation-test/compiler_crashers_2/035fa4d6c659f717.swift new file mode 100644 index 0000000000000..e1bbdfa2599ad --- /dev/null +++ b/validation-test/compiler_crashers_2/035fa4d6c659f717.swift @@ -0,0 +1,9 @@ +// {"kind":"emit-silgen","original":"caeb568b","signature":"swift::CanTypeWrapperTraits::type swift::SILType::castTo() const","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// RUN: not --crash %target-swift-frontend -emit-silgen %s +func a(d + : repeat Optional, body + : (repeat UnsafePointer) -> b) { + body(repeat { + each d + }) +} diff --git a/validation-test/compiler_crashers_2/05e8f12d4126e38b.swift b/validation-test/compiler_crashers_2/05e8f12d4126e38b.swift index f08c6c8365e0b..a8280e2da6400 100644 --- a/validation-test/compiler_crashers_2/05e8f12d4126e38b.swift +++ b/validation-test/compiler_crashers_2/05e8f12d4126e38b.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::CallerSideDefaultArgExprRequest::OutputType swift::Evaluator::getResultUncached(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'()>(swift::CallerSideDefaultArgExprRequest const&, swift::CallerSideDefaultArgExprRequest::OutputType swift::evaluateOrDefault(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'())"} +// {"kind":"typecheck","signature":"swift::CallerSideDefaultArgExprRequest::OutputType swift::Evaluator::getResultUncached(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'()>(swift::CallerSideDefaultArgExprRequest const&, swift::CallerSideDefaultArgExprRequest::OutputType swift::evaluateOrDefault(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'())::'lambda'()::operator()() const"} // RUN: not --crash %target-swift-frontend -typecheck %s func a (Int -> Int , Int = #sourceLocation5 diff --git a/validation-test/compiler_crashers_2/0634c65af0140195.swift b/validation-test/compiler_crashers_2/0634c65af0140195.swift index bde8f87a15ce6..78c0e117513be 100644 --- a/validation-test/compiler_crashers_2/0634c65af0140195.swift +++ b/validation-test/compiler_crashers_2/0634c65af0140195.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::PackType::getSingletonPackExpansion(swift::Type)","signatureAssert":"Assertion failed: (rootParameterPacks.size() >= 1), function getSingletonPackExpansion"} +// {"kind":"typecheck","signature":"swift::constraints::Solution::computeSubstitutions(swift::NullablePtr, swift::GenericSignature, swift::constraints::ConstraintLocator*) const","signatureAssert":"Assertion failed: (rootParameterPacks.size() >= 1), function getSingletonPackExpansion"} // RUN: not --crash %target-swift-frontend -typecheck %s class a func b < each c : a { b diff --git a/validation-test/compiler_crashers_2/1801de8a256df48e.swift b/validation-test/compiler_crashers_2/1801de8a256df48e.swift index ecf8220b91853..52c2fc108ba9e 100644 --- a/validation-test/compiler_crashers_2/1801de8a256df48e.swift +++ b/validation-test/compiler_crashers_2/1801de8a256df48e.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::rewriting::RequirementMachine::verify(swift::rewriting::MutableTerm const&) const"} +// {"kind":"typecheck","signature":"swift::rewriting::RequirementMachine::areReducedTypeParametersEqual(swift::Type, swift::Type) const"} // RUN: not --crash %target-swift-frontend -typecheck %s protocol a { typealias Index extension Collection where Self : a{b : Index} protocol a diff --git a/validation-test/compiler_crashers_2/18f909944df444ab.swift b/validation-test/compiler_crashers_2/18f909944df444ab.swift new file mode 100644 index 0000000000000..e2c7c5f70844e --- /dev/null +++ b/validation-test/compiler_crashers_2/18f909944df444ab.swift @@ -0,0 +1,10 @@ +// {"kind":"typecheck","original":"25bd9966","signature":"swift::rewriting::RequirementMachine::lookupNestedType(swift::Type, swift::Identifier) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a { + associatedtype b: Error +} +extension a { + protocol c { + #d( == e + } + class Error where b: c, b.d: diff --git a/validation-test/compiler_crashers_2/23dbe8bd740c095a.swift b/validation-test/compiler_crashers_2/23dbe8bd740c095a.swift index 71fd346745f36..8dedbfbb4a78c 100644 --- a/validation-test/compiler_crashers_2/23dbe8bd740c095a.swift +++ b/validation-test/compiler_crashers_2/23dbe8bd740c095a.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::TypeChecker::checkDeclAttributes(swift::Decl*)","signatureAssert":"Assertion failed: (detail::isPresent(Val) && \"dyn_cast on a non-existent value\"), function dyn_cast"} +// {"kind":"typecheck","signature":"(anonymous namespace)::AttributeChecker::visitImplementsAttr(swift::ImplementsAttr*)","signatureAssert":"Assertion failed: (detail::isPresent(Val) && \"dyn_cast on a non-existent value\"), function dyn_cast"} // RUN: not --crash %target-swift-frontend -typecheck %s protocol a { b } @_implements(a, b) typealias c = diff --git a/validation-test/compiler_crashers_2/2f2808f812c4a907.swift b/validation-test/compiler_crashers_2/2f2808f812c4a907.swift new file mode 100644 index 0000000000000..434fb581bbae7 --- /dev/null +++ b/validation-test/compiler_crashers_2/2f2808f812c4a907.swift @@ -0,0 +1,4 @@ +// {"kind":"typecheck","original":"4f0b1241","signature":"swift::Type llvm::function_ref::callback_fn<(anonymous namespace)::BuildForwardingSubstitutions>(long, swift::SubstitutableType*)","signatureAssert":"Assertion failed: (rootParameterPacks.size() >= 1), function getSingletonPackExpansion"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a: b + struct bis() && \"substituted shape mismatch: expected a scalar component\"), function projectLaneFromPackType"} +// {"kind":"typecheck","signature":"swift::InFlightSubstitution::projectLaneFromPackType(swift::Type, unsigned int)","signatureAssert":"Assertion failed: (!substEltType->is() && \"substituted shape mismatch: expected a scalar component\"), function projectLaneFromPackType"} // RUN: not --crash %target-swift-frontend -typecheck %s typealias a = () struct e < each b { typealias f = (repeat a)struct g < each c { diff --git a/validation-test/compiler_crashers_2/3b6836d8e254e362.swift b/validation-test/compiler_crashers_2/3b6836d8e254e362.swift index 04cc1a620d72e..bfc3392b28aec 100644 --- a/validation-test/compiler_crashers_2/3b6836d8e254e362.swift +++ b/validation-test/compiler_crashers_2/3b6836d8e254e362.swift @@ -1,4 +1,4 @@ -// {"signature":"(anonymous namespace)::Traversal::doIt(swift::Expr*)"} +// {"kind":"typecheck","signature":"(anonymous namespace)::ExprRewriter::visitDeclRefExpr(swift::DeclRefExpr*)"} // RUN: not --crash %target-swift-frontend -typecheck %s { for b 0 ..< 10 { diff --git a/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift b/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift index 0018f8d87839b..e3477157c237f 100644 --- a/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift +++ b/validation-test/compiler_crashers_2/3e3dd6a23227714f.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","original":"1e8c9260","signature":"(anonymous namespace)::ExprWalker::walkToExprPost(swift::Expr*)"} +// {"kind":"typecheck","original":"1e8c9260","signature":"(anonymous namespace)::ExprRewriter::visitKeyPathExpr(swift::KeyPathExpr*)"} // RUN: not --crash %target-swift-frontend -typecheck %s struct a { callAsFunction { diff --git a/validation-test/compiler_crashers_2/8d0890396bc3d7c9.swift b/validation-test/compiler_crashers_2/8d0890396bc3d7c9.swift index 17c032b246417..058115c6f4129 100644 --- a/validation-test/compiler_crashers_2/8d0890396bc3d7c9.swift +++ b/validation-test/compiler_crashers_2/8d0890396bc3d7c9.swift @@ -1,4 +1,4 @@ -// {"kind":"emit-silgen","original":"be1cdd08","signature":"swift::SILVisitorBase<(anonymous namespace)::SILVerifier, void>::visitSILBasicBlock(swift::SILBasicBlock*)"} +// {"kind":"emit-silgen","original":"be1cdd08","signature":"swift::verificationFailure(llvm::Twine const&, swift::SILInstruction const*, swift::SILArgument const*, std::__1::function const&)"} // RUN: not --crash %target-swift-frontend -emit-silgen %s // REQUIRES: OS=macosx import Foundation diff --git a/validation-test/compiler_crashers_2/9c85fde449ce1746.swift b/validation-test/compiler_crashers_2/9c85fde449ce1746.swift new file mode 100644 index 0000000000000..535e1c0f5bfad --- /dev/null +++ b/validation-test/compiler_crashers_2/9c85fde449ce1746.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","original":"379a5956","signature":"swift::rewriting::RequirementMachine::isConcreteType(swift::Type, swift::ProtocolDecl const*) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a { + associatedtype b: c where b.d == b + protocol c { + associatedtype d: a where d.b == Self + } +} diff --git a/validation-test/compiler_crashers_2/e4b31d519d2a86c4.swift b/validation-test/compiler_crashers_2/e4b31d519d2a86c4.swift new file mode 100644 index 0000000000000..1f25dfc00dc3c --- /dev/null +++ b/validation-test/compiler_crashers_2/e4b31d519d2a86c4.swift @@ -0,0 +1,7 @@ +// {"kind":"typecheck","original":"cb3e622a","signature":"swift::ast_scope::ASTScopeImpl::checkSourceRangeBeforeAddingChild(swift::ast_scope::ASTScopeImpl*, swift::ASTContext const&) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + let a, + () { + } +} diff --git a/validation-test/compiler_crashers_2/fef90fa2b91e98ff.swift b/validation-test/compiler_crashers_2/fef90fa2b91e98ff.swift index dfe17aeade848..40baf13bf6aea 100644 --- a/validation-test/compiler_crashers_2/fef90fa2b91e98ff.swift +++ b/validation-test/compiler_crashers_2/fef90fa2b91e98ff.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","signature":"swift::ExistentialArchetypeType::get(swift::CanType)","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} +// {"kind":"typecheck","signature":"swift::constraints::ConstraintSystem::getTypeOfMemberReferencePre(swift::constraints::OverloadChoice, swift::DeclContext*, swift::constraints::ConstraintLocator*, swift::constraints::PreparedOverloadBuilder*)","signatureAssert":"Assertion failed: (isa(Val) && \"cast() argument of incompatible type!\"), function cast"} // RUN: not --crash %target-swift-frontend -typecheck %s protocol a where b == Self protocol c : a where Self diff --git a/validation-test/compiler_crashers_2_fixed/b1508b2b1233b66a.swift b/validation-test/compiler_crashers_2_fixed/b1508b2b1233b66a.swift new file mode 100644 index 0000000000000..208ac63f0eeb1 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/b1508b2b1233b66a.swift @@ -0,0 +1,10 @@ +// {"kind":"typecheck","original":"001363f2","signature":"swift::ASTContext::getSpecializedConformance(swift::Type, swift::NormalProtocolConformance*, swift::SubstitutionMap)","signatureAssert":"Assertion failed: (substitutions.getGenericSignature().getCanonicalSignature() == generic->getGenericSignature().getCanonicalSignature()), function getSpecializedConformance"} +// RUN: not %target-swift-frontend -typecheck %s +protocol a { + associatedtype 1 +} +protocol b { + associatedtype c: a where d == Self + class e: a where f: b, f.c == Self { + } +}