Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions validation-test/IDE/crashers/0c2dce70e089243d.swift
Original file line number Diff line number Diff line change
@@ -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^#
2 changes: 1 addition & 1 deletion validation-test/IDE/crashers/10b243ac3f1f8d7b.swift
Original file line number Diff line number Diff line change
@@ -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<swift::NameLookupFlags, unsigned int>)","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
Expand Down
2 changes: 1 addition & 1 deletion validation-test/IDE/crashers/1e4621d80984121a.swift
Original file line number Diff line number Diff line change
@@ -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<swift::NameLookupFlags, unsigned int>)","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#^^#
5 changes: 5 additions & 0 deletions validation-test/IDE/crashers/631208e8e9212ebd.swift
Original file line number Diff line number Diff line change
@@ -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 {
#^^#
2 changes: 1 addition & 1 deletion validation-test/IDE/crashers/7621907bdc5958a6.swift
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions validation-test/IDE/crashers/7ee355a338d6ef78.swift
Original file line number Diff line number Diff line change
@@ -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
.#^^#
9 changes: 9 additions & 0 deletions validation-test/IDE/crashers/89642f94e4444b17.swift
Original file line number Diff line number Diff line change
@@ -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 = #^^#
2 changes: 1 addition & 1 deletion validation-test/IDE/crashers/93646f990f2e8498.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions validation-test/IDE/crashers/98bd083880c2694d.swift
Original file line number Diff line number Diff line change
@@ -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 >
#^^#
2 changes: 1 addition & 1 deletion validation-test/IDE/crashers/b702ab48c2f29a3a.swift
Original file line number Diff line number Diff line change
@@ -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<b{ c { struct d<f where f.e#^COMPLETE^#
2 changes: 1 addition & 1 deletion validation-test/IDE/crashers/dac2016ff43c557e.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// {"kind":"complete","signature":"swift::FragileFunctionKindRequest::OutputType swift::Evaluator::getResultUncached<swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType swift::evaluateOrDefault<swift::FragileFunctionKindRequest>(swift::Evaluator&, swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType)::'lambda'()>(swift::FragileFunctionKindRequest const&, swift::FragileFunctionKindRequest::OutputType swift::evaluateOrDefault<swift::FragileFunctionKindRequest>(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::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType swift::evaluateOrDefault<swift::FragileFunctionKindRequest>(swift::Evaluator&, swift::FragileFunctionKindRequest, swift::FragileFunctionKindRequest::OutputType)::'lambda'()>(swift::FragileFunctionKindRequest const&, swift::FragileFunctionKindRequest::OutputType swift::evaluateOrDefault<swift::FragileFunctionKindRequest>(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^#
5 changes: 5 additions & 0 deletions validation-test/IDE/crashers/e6e38c515da4fe5a.swift
Original file line number Diff line number Diff line change
@@ -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
.#^^#
9 changes: 9 additions & 0 deletions validation-test/compiler_crashers_2/035fa4d6c659f717.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// {"kind":"emit-silgen","original":"caeb568b","signature":"swift::CanTypeWrapperTraits<swift::SILFunctionType>::type swift::SILType::castTo<swift::SILFunctionType>() const","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
// RUN: not --crash %target-swift-frontend -emit-silgen %s
func a<b, each c>(d
: repeat Optional<each c>, body
: (repeat UnsafePointer<each c>) -> b) {
body(repeat {
each d
})
}
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/05e8f12d4126e38b.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// {"kind":"typecheck","signature":"swift::CallerSideDefaultArgExprRequest::OutputType swift::Evaluator::getResultUncached<swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType swift::evaluateOrDefault<swift::CallerSideDefaultArgExprRequest>(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'()>(swift::CallerSideDefaultArgExprRequest const&, swift::CallerSideDefaultArgExprRequest::OutputType swift::evaluateOrDefault<swift::CallerSideDefaultArgExprRequest>(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'())"}
// {"kind":"typecheck","signature":"swift::CallerSideDefaultArgExprRequest::OutputType swift::Evaluator::getResultUncached<swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType swift::evaluateOrDefault<swift::CallerSideDefaultArgExprRequest>(swift::Evaluator&, swift::CallerSideDefaultArgExprRequest, swift::CallerSideDefaultArgExprRequest::OutputType)::'lambda'()>(swift::CallerSideDefaultArgExprRequest const&, swift::CallerSideDefaultArgExprRequest::OutputType swift::evaluateOrDefault<swift::CallerSideDefaultArgExprRequest>(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
Expand Down
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/0634c65af0140195.swift
Original file line number Diff line number Diff line change
@@ -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::ValueDecl>, 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
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/1801de8a256df48e.swift
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions validation-test/compiler_crashers_2/18f909944df444ab.swift
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/23dbe8bd740c095a.swift
Original file line number Diff line number Diff line change
@@ -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 =
4 changes: 4 additions & 0 deletions validation-test/compiler_crashers_2/2f2808f812c4a907.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// {"kind":"typecheck","original":"4f0b1241","signature":"swift::Type llvm::function_ref<swift::Type (swift::SubstitutableType*)>::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 b<each c: a { c:
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/361c5acf488944d1.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// {"kind":"typecheck","signature":"swift::InFlightSubstitution::substType(swift::SubstitutableType*, unsigned int)","signatureAssert":"Assertion failed: (!substEltType->is<PackExpansionType>() && \"substituted shape mismatch: expected a scalar component\"), function projectLaneFromPackType"}
// {"kind":"typecheck","signature":"swift::InFlightSubstitution::projectLaneFromPackType(swift::Type, unsigned int)","signatureAssert":"Assertion failed: (!substEltType->is<PackExpansionType>() && \"substituted shape mismatch: expected a scalar component\"), function projectLaneFromPackType"}
// RUN: not --crash %target-swift-frontend -typecheck %s
typealias a<b, c, d> = () struct e < each b {
typealias f<each c, d> = (repeat a<each b, each c, d>)struct g < each c {
Expand Down
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/3b6836d8e254e362.swift
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/3e3dd6a23227714f.swift
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/8d0890396bc3d7c9.swift
Original file line number Diff line number Diff line change
@@ -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<void ()> const&)"}
// RUN: not --crash %target-swift-frontend -emit-silgen %s
// REQUIRES: OS=macosx
import Foundation
Expand Down
8 changes: 8 additions & 0 deletions validation-test/compiler_crashers_2/9c85fde449ce1746.swift
Original file line number Diff line number Diff line change
@@ -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
}
}
7 changes: 7 additions & 0 deletions validation-test/compiler_crashers_2/e4b31d519d2a86c4.swift
Original file line number Diff line number Diff line change
@@ -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,
() {
}
}
2 changes: 1 addition & 1 deletion validation-test/compiler_crashers_2/fef90fa2b91e98ff.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// {"kind":"typecheck","signature":"swift::ExistentialArchetypeType::get(swift::CanType)","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() 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<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
// RUN: not --crash %target-swift-frontend -typecheck %s
protocol a where b == Self
protocol c : a where Self
Expand Down
10 changes: 10 additions & 0 deletions validation-test/compiler_crashers_2_fixed/b1508b2b1233b66a.swift
Original file line number Diff line number Diff line change
@@ -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<f>: a where f: b, f.c == Self {
}
}