diff --git a/lib/Sema/CSDiagnostics.h b/lib/Sema/CSDiagnostics.h index ff1346f404091..1c58ae5862b43 100644 --- a/lib/Sema/CSDiagnostics.h +++ b/lib/Sema/CSDiagnostics.h @@ -2170,7 +2170,7 @@ class ArgumentMismatchFailure : public ContextualFailure { FixBehavior fixBehavior = FixBehavior::Error) : ContextualFailure(solution, argType, paramType, locator, fixBehavior), - Info(*getFunctionArgApplyInfo(getLocator())) {} + Info(getFunctionArgApplyInfo(getLocator()).value()) {} bool diagnoseAsError() override; bool diagnoseAsNote() override; diff --git a/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift b/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift new file mode 100644 index 0000000000000..11a0aaa5dad51 --- /dev/null +++ b/validation-test/IDE/crashers/10b243ac3f1f8d7b.swift @@ -0,0 +1,6 @@ +// {"kind":"complete","signature":"swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +extension <#type#> { + var + a = "title \( init String * 0).General\(String#^COMPLETE^#0))" +} diff --git a/validation-test/IDE/crashers/1118c1956154924d.swift b/validation-test/IDE/crashers/1118c1956154924d.swift new file mode 100644 index 0000000000000..8bca91081a418 --- /dev/null +++ b/validation-test/IDE/crashers/1118c1956154924d.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"swift::constraints::ConstraintSystem::assignFixedType(swift::TypeVariableType*, swift::Type, bool, bool)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +[ _""#^COMPLETE^# diff --git a/validation-test/IDE/crashers/15d1c6f76ad86540.swift b/validation-test/IDE/crashers/15d1c6f76ad86540.swift new file mode 100644 index 0000000000000..cd53a554f91f8 --- /dev/null +++ b/validation-test/IDE/crashers/15d1c6f76ad86540.swift @@ -0,0 +1,6 @@ +// {"kind":"complete","signature":"swift::GenericSignatureImpl::getReducedType(swift::Type) const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +protocol a: Collection where Iterator == b { + struct b: IteratorProtocol + func d -> + #^COMPLETE^# diff --git a/validation-test/IDE/crashers/1ac322cbf02c111.swift b/validation-test/IDE/crashers/1ac322cbf02c111.swift new file mode 100644 index 0000000000000..461d8ef8ed870 --- /dev/null +++ b/validation-test/IDE/crashers/1ac322cbf02c111.swift @@ -0,0 +1,6 @@ +// {"kind":"complete","signature":"swift::IterableDeclContext::addMemberSilently(swift::Decl*, swift::Decl*, bool) const::$_0::operator()(swift::Decl*, swift::Decl*) const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +class a {b { { [ } ] in +#^COMPLETE^# +} +c) diff --git a/validation-test/IDE/crashers/23da5344b07b939.swift b/validation-test/IDE/crashers/23da5344b07b939.swift new file mode 100644 index 0000000000000..59ade97a449bb --- /dev/null +++ b/validation-test/IDE/crashers/23da5344b07b939.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"swift::AnyFunctionType::getExtInfo() const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +func a(b) a#^COMPLETE^# diff --git a/validation-test/IDE/crashers/34e0183b6ceafde.swift b/validation-test/IDE/crashers/34e0183b6ceafde.swift new file mode 100644 index 0000000000000..4dcd8797e7771 --- /dev/null +++ b/validation-test/IDE/crashers/34e0183b6ceafde.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::ast_scope::ASTScopeImpl::getCharSourceRangeOfScope(swift::SourceManager&, bool) const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +var a: b { + @ #^COMPLETE^# diff --git a/validation-test/IDE/crashers/3d85becf2d330a5.swift b/validation-test/IDE/crashers/3d85becf2d330a5.swift new file mode 100644 index 0000000000000..9fbc5cb938b4e --- /dev/null +++ b/validation-test/IDE/crashers/3d85becf2d330a5.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"swift::Parser::consumeIdentifier(swift::Identifier&, bool)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +switch { case borrowing #^COMPLETE^# diff --git a/validation-test/IDE/crashers/488be7ca295930f4.swift b/validation-test/IDE/crashers/488be7ca295930f4.swift new file mode 100644 index 0000000000000..ced89073a1dcb --- /dev/null +++ b/validation-test/IDE/crashers/488be7ca295930f4.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","signature":"doPrintTypeInterface(swift::CompilerInvocation const&, llvm::StringRef, llvm::StringRef)"} +// Actual signature: checkSingleOverride +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +class a { subscript(a) a { set } class b : a { override subscript(a) a { +#^COMPLETE^# diff --git a/validation-test/IDE/crashers/4c8b451fbe19cd6.swift b/validation-test/IDE/crashers/4c8b451fbe19cd6.swift new file mode 100644 index 0000000000000..121d9a50ede5e --- /dev/null +++ b/validation-test/IDE/crashers/4c8b451fbe19cd6.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"(anonymous namespace)::PreCheckTarget::simplifyTypeExpr(swift::Expr*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +macro a = { #^COMPLETE^# diff --git a/validation-test/IDE/crashers/524ea7a5cd78074.swift b/validation-test/IDE/crashers/524ea7a5cd78074.swift new file mode 100644 index 0000000000000..b05a97a06bcd6 --- /dev/null +++ b/validation-test/IDE/crashers/524ea7a5cd78074.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"swift::Mangle::Mangler::finalize(llvm::raw_ostream&)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +struct a { extension b { struct c { struct d { let b = switch { case return } func c -> #^COMPLETE^# diff --git a/validation-test/IDE/crashers/73f3b9a72697ee92.swift b/validation-test/IDE/crashers/73f3b9a72697ee92.swift new file mode 100644 index 0000000000000..18e18dd36d541 --- /dev/null +++ b/validation-test/IDE/crashers/73f3b9a72697ee92.swift @@ -0,0 +1,11 @@ +// {"kind":"complete","signature":"swift::GenericSignatureImpl::isValidTypeParameter(swift::Type) const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -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 { + #^COMPLETE^# var + b: Never diff --git a/validation-test/IDE/crashers/7dfd3dd444f43abb.swift b/validation-test/IDE/crashers/7dfd3dd444f43abb.swift new file mode 100644 index 0000000000000..4147704ddc4bf --- /dev/null +++ b/validation-test/IDE/crashers/7dfd3dd444f43abb.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::TypeBase::isEqual(swift::Type) const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +Set( +##^COMPLETE^# diff --git a/validation-test/IDE/crashers/8447838e019fde.swift b/validation-test/IDE/crashers/8447838e019fde.swift new file mode 100644 index 0000000000000..6a75c362b5588 --- /dev/null +++ b/validation-test/IDE/crashers/8447838e019fde.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::ParserStatus llvm::function_ref::callback_fn&, swift::SourceLoc&, swift::Parser::DefaultArgumentInfo*, swift::Parser::ParameterContextKind)::$_0>(long)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +func 丏(=1 as +#^COMPLETE^# diff --git a/validation-test/IDE/crashers/8659dc98be5856f6.swift b/validation-test/IDE/crashers/8659dc98be5856f6.swift new file mode 100644 index 0000000000000..2f10d4118da04 --- /dev/null +++ b/validation-test/IDE/crashers/8659dc98be5856f6.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +extension { +a { discard b#^COMPLETE^# diff --git a/validation-test/IDE/crashers/8681205caefae96e.swift b/validation-test/IDE/crashers/8681205caefae96e.swift new file mode 100644 index 0000000000000..0ad1af306a488 --- /dev/null +++ b/validation-test/IDE/crashers/8681205caefae96e.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::ide::CompletionLookup::getPostfixKeywordCompletions(swift::Type, swift::Expr*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +func a(b: (() -> Float)!) { +b()#^COMPLETE^# diff --git a/validation-test/IDE/crashers/88724bf42982b346.swift b/validation-test/IDE/crashers/88724bf42982b346.swift new file mode 100644 index 0000000000000..adc808185ae95 --- /dev/null +++ b/validation-test/IDE/crashers/88724bf42982b346.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::ide::printTypeUSR(swift::Type, llvm::raw_ostream&)"} +// Actual signature: getContextSubstitutions +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +protocol a extension a where Self == { extension a#^COMPLETE^# protocol b diff --git a/validation-test/IDE/crashers/96faa1ddefcb57f.swift b/validation-test/IDE/crashers/96faa1ddefcb57f.swift new file mode 100644 index 0000000000000..91e3e74e9e2c5 --- /dev/null +++ b/validation-test/IDE/crashers/96faa1ddefcb57f.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::Demangle::ASTBuilder::findTypeDecl(swift::DeclContext*, swift::Identifier, swift::Identifier, swift::Demangle::Node::Kind)"} +// Actual signature: openTypeParameter +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +struct a, llvm::ArrayRef, swift::GenericSignature, bool)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +func a( repeat each b)c == a( +#^COMPLETE^# d diff --git a/validation-test/IDE/crashers/a41cd43f2f603f31.swift b/validation-test/IDE/crashers/a41cd43f2f603f31.swift new file mode 100644 index 0000000000000..1290840d2f1c4 --- /dev/null +++ b/validation-test/IDE/crashers/a41cd43f2f603f31.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"(anonymous namespace)::CodeCompletionCallbacksImpl::completeAccessorBeginning(swift::CodeCompletionExpr*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +case <#expression#>= { protocol a { #^COMPLETE^# diff --git a/validation-test/IDE/crashers/a51bc03e2023ede5.swift b/validation-test/IDE/crashers/a51bc03e2023ede5.swift new file mode 100644 index 0000000000000..7c8fb10b70c68 --- /dev/null +++ b/validation-test/IDE/crashers/a51bc03e2023ede5.swift @@ -0,0 +1,3 @@ +// {"kind":"complete","signature":"swift::constraints::ConstraintSystem::buildDisjunctionForOptionalVsUnderlying(swift::Type, swift::Type, swift::constraints::ConstraintLocator*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +class a {b: c! = b #^COMPLETE^# diff --git a/validation-test/IDE/crashers/ab16c0e38dae31b3.swift b/validation-test/IDE/crashers/ab16c0e38dae31b3.swift new file mode 100644 index 0000000000000..ca9c1a54d6279 --- /dev/null +++ b/validation-test/IDE/crashers/ab16c0e38dae31b3.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","signature":"swift::Mangle::ASTMangler::appendType(swift::Type, swift::GenericSignature, swift::ValueDecl const*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +func a) const"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -source-filename %s +class a: a#^COMPLETE^# diff --git a/validation-test/IDE/crashers/f98762f9df9ed0fa.swift b/validation-test/IDE/crashers/f98762f9df9ed0fa.swift new file mode 100644 index 0000000000000..2bd61b6ada5e0 --- /dev/null +++ b/validation-test/IDE/crashers/f98762f9df9ed0fa.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","signature":"swift::rewriting::RewriteContext::getMutableTermForType(swift::CanType, swift::ProtocolDecl const*)"} +// RUN: not --crash %target-swift-ide-test -code-completion --code-completion-token=COMPLETE -code-completion-diagnostics -source-filename %s +protocol a { associatedtype b } +protocol c { associatedtype b } +extension c { compose(repeat each d, e: ( +} +func bar(a: b) { + a.c(e : "" diff --git a/validation-test/compiler_crashers_2/2c8d3a95fcb84248.swift b/validation-test/compiler_crashers_2/2c8d3a95fcb84248.swift new file mode 100644 index 0000000000000..8b7da5a499807 --- /dev/null +++ b/validation-test/compiler_crashers_2/2c8d3a95fcb84248.swift @@ -0,0 +1,7 @@ +// {"kind":"typecheck","signature":"swift::recordRequiredImportAccessLevelForDecl(swift::Decl const*, swift::DeclContext const*, swift::AccessLevel, std::__1::function)>)"} +// RUN: %empty-directory(%t) +// RUN: not --crash %target-swift-frontend -typecheck -sdk %t %s +// REQUIRES: OS=macosx +import Distributed +distributed actor a { +} diff --git a/validation-test/compiler_crashers_2/35c1917cd0f5ba23.swift b/validation-test/compiler_crashers_2/35c1917cd0f5ba23.swift new file mode 100644 index 0000000000000..3649786c52270 --- /dev/null +++ b/validation-test/compiler_crashers_2/35c1917cd0f5ba23.swift @@ -0,0 +1,7 @@ +// {"signature":"swift::ASTWalker::PostWalkResult (anonymous namespace)::Verifier::dispatchVisitPost(swift::DynamicTypeExpr*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +class a { +} +[].filter { + type(of: $0) == a.self +} diff --git a/validation-test/compiler_crashers_2/5cc8bc3069f97958.swift b/validation-test/compiler_crashers_2/5cc8bc3069f97958.swift new file mode 100644 index 0000000000000..397d341592303 --- /dev/null +++ b/validation-test/compiler_crashers_2/5cc8bc3069f97958.swift @@ -0,0 +1,8 @@ +// {"kind":"typecheck","signature":"(anonymous namespace)::TypeResolver::resolveImplicitlyUnwrappedOptionalType(swift::ImplicitlyUnwrappedOptionalTypeRepr*, swift::TypeResolutionOptions, bool)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + enum a: b! { + } + guard a else { + } +} diff --git a/validation-test/compiler_crashers_2/70bfb18ab58de217.swift b/validation-test/compiler_crashers_2/70bfb18ab58de217.swift new file mode 100644 index 0000000000000..d023d8f37e0f7 --- /dev/null +++ b/validation-test/compiler_crashers_2/70bfb18ab58de217.swift @@ -0,0 +1,4 @@ +// {"signature":"swift::GenericContext::getGenericSignature() const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a < let b : c + class c < b : a diff --git a/validation-test/compiler_crashers_2/78fae776bebcee10.swift b/validation-test/compiler_crashers_2/78fae776bebcee10.swift new file mode 100644 index 0000000000000..c93101f6eb54c --- /dev/null +++ b/validation-test/compiler_crashers_2/78fae776bebcee10.swift @@ -0,0 +1,7 @@ +// {"signature":"swift::QualifiedLookupRequest::evaluate(swift::Evaluator&, swift::DeclContext const*, llvm::SmallVector, swift::DeclNameRef, swift::NLOptions) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + extension a { + b { + func c(e : d) { + e = f diff --git a/validation-test/compiler_crashers_2/7c811b5446136.swift b/validation-test/compiler_crashers_2/7c811b5446136.swift new file mode 100644 index 0000000000000..cea906fe0588d --- /dev/null +++ b/validation-test/compiler_crashers_2/7c811b5446136.swift @@ -0,0 +1,6 @@ +// {"signature":"swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::optionset::OptionSet, swift::constraints::ConstraintLocatorBuilder)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +weak var a : b? a +class c + class b + weak var a: c? diff --git a/validation-test/compiler_crashers_2/82fe033c6bdba61.swift b/validation-test/compiler_crashers_2/82fe033c6bdba61.swift new file mode 100644 index 0000000000000..4fbab283269b3 --- /dev/null +++ b/validation-test/compiler_crashers_2/82fe033c6bdba61.swift @@ -0,0 +1,8 @@ +// {"signature":"swift::ReferencedAssociatedTypesRequest::evaluate(swift::Evaluator&, swift::ValueDecl*) const::Walker::walkToTypePre(swift::Type)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a { + var + b, c : Codable { + self + } +} diff --git a/validation-test/compiler_crashers_2/87bf05037516d84.swift b/validation-test/compiler_crashers_2/87bf05037516d84.swift new file mode 100644 index 0000000000000..22ab40268b63c --- /dev/null +++ b/validation-test/compiler_crashers_2/87bf05037516d84.swift @@ -0,0 +1,14 @@ +// {"kind":"typecheck","signature":"swift::rewriting::RewritePathEvaluator::applyRewriteRule(swift::rewriting::RewriteStep const&, swift::rewriting::RewriteSystem const&)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a { + associatedtype b : a where b.b == c +} +protocol d { + associatedtype e : a + associatedtype c : d + struct f : d { + typealias c = f + protocol g : d where c == f { + } + } +} diff --git a/validation-test/compiler_crashers_2/8867bfc8cf158ddb.swift b/validation-test/compiler_crashers_2/8867bfc8cf158ddb.swift new file mode 100644 index 0000000000000..4916596578a2b --- /dev/null +++ b/validation-test/compiler_crashers_2/8867bfc8cf158ddb.swift @@ -0,0 +1,8 @@ +// {"signature":"swift::ClassDecl::isSuperclassOf(swift::ClassDecl const*) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +class a { + typealias b = <#type#> +} +class c< d > : a< > { +} +c.b diff --git a/validation-test/compiler_crashers_2/89acda2815351ec6.swift b/validation-test/compiler_crashers_2/89acda2815351ec6.swift new file mode 100644 index 0000000000000..31329055ee16d --- /dev/null +++ b/validation-test/compiler_crashers_2/89acda2815351ec6.swift @@ -0,0 +1,5 @@ +// {"signature":"(anonymous namespace)::ExprRewriter::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocatorBuilder)::$_3::operator()(swift::Type, swift::Type) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +func a(inout _ ) +var b = String +a(b diff --git a/validation-test/compiler_crashers_2/8b32e8ab4ca6b321.swift b/validation-test/compiler_crashers_2/8b32e8ab4ca6b321.swift new file mode 100644 index 0000000000000..bd42c5a68b171 --- /dev/null +++ b/validation-test/compiler_crashers_2/8b32e8ab4ca6b321.swift @@ -0,0 +1,6 @@ +// {"kind":"typecheck","signature":"swift::AnyFunctionType* swift::TypeBase::castTo()"} +// RUN: not --crash %target-swift-frontend -typecheck %s +subscript(a: Int?) -> <#type#> { + var b = a + Float(b) +} diff --git a/validation-test/compiler_crashers_2/ad9313b914fb2.swift b/validation-test/compiler_crashers_2/ad9313b914fb2.swift new file mode 100644 index 0000000000000..f734160ac5511 --- /dev/null +++ b/validation-test/compiler_crashers_2/ad9313b914fb2.swift @@ -0,0 +1,5 @@ +// {"signature":"swift::SimpleRequest, swift::InvertibleProtocolSet> (llvm::PointerUnion, unsigned int), (swift::RequestFlags)1>::noteCycleStep(swift::DiagnosticEngine&) const"} +// RUN: not --crash %target-swift-frontend -typecheck %s +class a + let _ b = a + class b : b.c diff --git a/validation-test/compiler_crashers_2/c232a2df5b6fffd.swift b/validation-test/compiler_crashers_2/c232a2df5b6fffd.swift new file mode 100644 index 0000000000000..c173b4d3b0698 --- /dev/null +++ b/validation-test/compiler_crashers_2/c232a2df5b6fffd.swift @@ -0,0 +1,8 @@ +// {"signature":"swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, swift::DeclContext*, bool, swift::FunctionRefInfo, swift::constraints::ConstraintLocator*, llvm::SmallVectorImpl>*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a < let b > { + func + < (c : Self) { + c.b + } +} diff --git a/validation-test/compiler_crashers_2/c7f6f9dc8e8c9d71.swift b/validation-test/compiler_crashers_2/c7f6f9dc8e8c9d71.swift new file mode 100644 index 0000000000000..9ee53fd4b1b50 --- /dev/null +++ b/validation-test/compiler_crashers_2/c7f6f9dc8e8c9d71.swift @@ -0,0 +1,12 @@ +// {"signature":"swift::constraints::ConstraintSystem::setBuilderTransformedBody(swift::AnyFunctionRef, swift::NominalTypeDecl*, swift::NullablePtr, swift::NullablePtr)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a { + @resultBuilder struct b + } + struct c < d { + init(@b content : () -> d + } + extension c : a + struct b { +e { + c { diff --git a/validation-test/compiler_crashers_2/d5eedcc26a9ca1f.swift b/validation-test/compiler_crashers_2/d5eedcc26a9ca1f.swift new file mode 100644 index 0000000000000..e13a33c768da6 --- /dev/null +++ b/validation-test/compiler_crashers_2/d5eedcc26a9ca1f.swift @@ -0,0 +1,8 @@ +// {"signature":"swift::TypeBase::getReducedShape()"} +// RUN: not --crash %target-swift-frontend -typecheck %s +typealias a = () +extension a { +c { + d +} +d diff --git a/validation-test/compiler_crashers_2/da315410694f4a15.swift b/validation-test/compiler_crashers_2/da315410694f4a15.swift new file mode 100644 index 0000000000000..99272b7d66dc3 --- /dev/null +++ b/validation-test/compiler_crashers_2/da315410694f4a15.swift @@ -0,0 +1,7 @@ +// {"signature":"extendDepthMap(swift::Expr*, llvm::DenseMap, llvm::DenseMapInfo, llvm::detail::DenseMapPair>>&)::RecordingTraversal::walkToExprPost(swift::Expr*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + { + func a { + if + #_hasSymbol( diff --git a/validation-test/compiler_crashers_2/ef6fa0626973e94.swift b/validation-test/compiler_crashers_2/ef6fa0626973e94.swift new file mode 100644 index 0000000000000..24a2275048460 --- /dev/null +++ b/validation-test/compiler_crashers_2/ef6fa0626973e94.swift @@ -0,0 +1,8 @@ +// {"signature":"(anonymous namespace)::ImplicitSelfUsageChecker::isClosureRequiringSelfQualification(swift::AbstractClosureExpr const*, bool)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +struct a : ExpressibleByBooleanLiteral { + c(d : Bool -> ( +} +{ + a(true).c { + b in diff --git a/validation-test/compiler_crashers_2/fef9fa2b91e98ff.swift b/validation-test/compiler_crashers_2/fef9fa2b91e98ff.swift new file mode 100644 index 0000000000000..377577922d0b2 --- /dev/null +++ b/validation-test/compiler_crashers_2/fef9fa2b91e98ff.swift @@ -0,0 +1,6 @@ +// {"signature":"swift::ExistentialArchetypeType::get(swift::CanType)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a where b == Self + protocol c : a where Self + : CustomStringConvertible + var d e c.description diff --git a/validation-test/compiler_crashers_2_fixed/6c90501cdf1449c2.swift b/validation-test/compiler_crashers_2_fixed/6c90501cdf1449c2.swift new file mode 100644 index 0000000000000..dc356a10e5e93 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/6c90501cdf1449c2.swift @@ -0,0 +1,3 @@ +// {"signature":"$s11swiftASTGen15parseSourceFile6buffer10moduleName8filename14declContextPtr4kindSVSo16BridgedStringRefV_A2ISvSgSo0n9GenerateddE4KindVtF"} +// RUN: not %target-swift-frontend -typecheck %s +"foobar""" a ab"""