diff --git a/validation-test/IDE/crashers/4334b05c244e77cf.swift b/validation-test/IDE/crashers/4334b05c244e77cf.swift new file mode 100644 index 0000000000000..35e4d930ed518 --- /dev/null +++ b/validation-test/IDE/crashers/4334b05c244e77cf.swift @@ -0,0 +1,11 @@ +// {"kind":"complete","original":"1a6ddccd","signature":"getRequirementMachine"} +// 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 { + public( #^^# + b: Never diff --git a/validation-test/IDE/crashers/55f0ac4dba91c84.swift b/validation-test/IDE/crashers/55f0ac4dba91c84.swift new file mode 100644 index 0000000000000..5cb1e3ea4d47e --- /dev/null +++ b/validation-test/IDE/crashers/55f0ac4dba91c84.swift @@ -0,0 +1,9 @@ +// {"kind":"complete","original":"df6ac250","signature":"bool llvm::function_ref::callback_fn(long, swift::constraints::Constraint*)","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 +struct a { +b func b() + #if { + b(<#expression#>) + }#^^# + #endif +} diff --git a/validation-test/IDE/crashers/c9b7522368139eb7.swift b/validation-test/IDE/crashers/c9b7522368139eb7.swift new file mode 100644 index 0000000000000..5ce57ee115ef7 --- /dev/null +++ b/validation-test/IDE/crashers/c9b7522368139eb7.swift @@ -0,0 +1,8 @@ +// {"kind":"complete","original":"ad5b343d","signature":"swift::InterfaceTypeRequest::cacheResult(swift::Type) const","signatureAssert":"Assertion failed: (!type->is() && \"Interface type must be materializable\"), function cacheResult"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +[ + #^^# +].reduce?( + [:][0] { + $a, b in + }) diff --git a/validation-test/IDE/crashers/dc8881dce3e968b.swift b/validation-test/IDE/crashers/dc8881dce3e968b.swift new file mode 100644 index 0000000000000..983371128574c --- /dev/null +++ b/validation-test/IDE/crashers/dc8881dce3e968b.swift @@ -0,0 +1,4 @@ +// {"kind":"complete","original":"6384b7fc","signature":"swift::TypeChecker::typeCheckForCodeCompletion(swift::constraints::SyntacticElementTarget&, bool, llvm::function_ref)","signatureAssert":"Assertion failed: (fallback->E != expr), function typeCheckForCodeCompletion"} +// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s +func a -> b +a > (c > a #^^# )' diff --git a/validation-test/IDE/crashers/dffa2c2577e3e11.swift b/validation-test/IDE/crashers/dffa2c2577e3e11.swift new file mode 100644 index 0000000000000..39bec6441535a --- /dev/null +++ b/validation-test/IDE/crashers/dffa2c2577e3e11.swift @@ -0,0 +1,5 @@ +// {"kind":"complete","original":"7f4bcc9e","signature":"swift::DeclContext::getDeclaredInterfaceType() const","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 Sequence where a == b[ { + func c() -> #^^# +} diff --git a/validation-test/IDE/crashers/e8698acd627edfb.swift b/validation-test/IDE/crashers/e8698acd627edfb.swift index f183284574569..06b8998c8febe 100644 --- a/validation-test/IDE/crashers/e8698acd627edfb.swift +++ b/validation-test/IDE/crashers/e8698acd627edfb.swift @@ -1,3 +1,3 @@ -// {"kind":"complete","original":"bae855bf","signature":"swift::GenericSignatureRequest::diagnoseCycle(swift::DiagnosticEngine&) const","signatureAssert":"Assertion failed: (!ActiveDiagnostic && \"Already have an active diagnostic\"), function diagnose"} +// {"kind":"complete","original":"bae855bf","signature":"swift::GenericTypeParamDecl::getSourceRange() const","signatureAssert":"Assertion failed: (Start.isValid() == End.isValid() && \"Start and end should either both be valid or both be invalid!\"), function SourceRange"} // RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s class a { +} +extension [b] { + func d() { + first + } +} diff --git a/validation-test/compiler_crashers_2/2a435f4c7a59cd72.swift b/validation-test/compiler_crashers_2/2a435f4c7a59cd72.swift new file mode 100644 index 0000000000000..dabec35c339f8 --- /dev/null +++ b/validation-test/compiler_crashers_2/2a435f4c7a59cd72.swift @@ -0,0 +1,10 @@ +// {"kind":"typecheck","original":"b3234b81","signature":"swift::constraints::ConstraintSystem::recordImpliedResult(swift::Expr*, swift::constraints::ImpliedResultKind)","signatureAssert":"Assertion failed: (inserted && \"Duplicate implied result?\"), function recordImpliedResult"} +// RUN: not --crash %target-swift-frontend -typecheck %s +[ + switch 0 { + case .a( + if <#expression#> { + b + }): + } +] diff --git a/validation-test/compiler_crashers_2/5b22e7353651698.swift b/validation-test/compiler_crashers_2/5b22e7353651698.swift new file mode 100644 index 0000000000000..94a6caf1c03a0 --- /dev/null +++ b/validation-test/compiler_crashers_2/5b22e7353651698.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","original":"6f23f24c","signature":"diagnoseUnintendedOptionalBehavior(swift::Expr const*, swift::DeclContext const*)::UnintendedOptionalBehaviorWalker::walkToExprPre(swift::Expr*)"} +// RUN: not --crash %target-swift-frontend -typecheck %s +{ + @<#type#> + #a { + &b + 0 as c + } +} diff --git a/validation-test/compiler_crashers_2/699345a5431680.swift b/validation-test/compiler_crashers_2/699345a5431680.swift new file mode 100644 index 0000000000000..2a327f0443766 --- /dev/null +++ b/validation-test/compiler_crashers_2/699345a5431680.swift @@ -0,0 +1,10 @@ +// {"kind":"typecheck","original":"96fa6e3e","signature":"swift::StorageImplInfoRequest::evaluate(swift::Evaluator&, swift::AbstractStorageDecl*) const","signatureAssert":"Assertion failed: (info.hasStorage() == storage->hasStorage() || storage->getASTContext().Diags.hadAnyError()), function evaluate"} +// RUN: not --crash %target-swift-frontend -typecheck %s +class a { + func b() { + override var c: Any { + didSet { + } + } + } +} diff --git a/validation-test/compiler_crashers_2/75bcc84cc8b7789.swift b/validation-test/compiler_crashers_2/75bcc84cc8b7789.swift new file mode 100644 index 0000000000000..f42947e9b5095 --- /dev/null +++ b/validation-test/compiler_crashers_2/75bcc84cc8b7789.swift @@ -0,0 +1,5 @@ +// {"kind":"typecheck","original":"7e87f396","signature":"swift::Mangle::ASTMangler::appendOpaqueTypeArchetype(swift::ArchetypeType*, swift::OpaqueTypeDecl*, swift::SubstitutionMap, swift::GenericSignature, swift::ValueDecl const*)","signatureAssert":"Assertion failed: (subs.isIdentity()), function appendOpaqueTypeArchetype"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a + func b -> some a where c += diff --git a/validation-test/compiler_crashers_2/a8c84d1122922f83.swift b/validation-test/compiler_crashers_2/a8c84d1122922f83.swift index b9284f0570787..4c301f4bd4a06 100644 --- a/validation-test/compiler_crashers_2/a8c84d1122922f83.swift +++ b/validation-test/compiler_crashers_2/a8c84d1122922f83.swift @@ -1,4 +1,4 @@ -// {"kind":"typecheck","original":"bee4b7dd","signature":"swift::constraints::ContextualFailure::tryProtocolConformanceFixIt(swift::InFlightDiagnostic&) const","signatureAssert":"Assertion failed: (!missingProtoTypeStrings.empty() && \"type already conforms to all the protocols?\"), function tryProtocolConformanceFixIt"} +// {"kind":"typecheck","original":"bee4b7dd","signature":"swift::constraints::ContextualFailure::tryProtocolConformanceFixIt() const","signatureAssert":"Assertion failed: (!missingProtoTypeStrings.empty() && \"type already conforms to all the protocols?\"), function tryProtocolConformanceFixIt"} // RUN: not --crash %target-swift-frontend -typecheck %s protocol a { associatedtype b diff --git a/validation-test/compiler_crashers_2/be64bc4123212eee.swift b/validation-test/compiler_crashers_2/be64bc4123212eee.swift new file mode 100644 index 0000000000000..57deb1849cd6b --- /dev/null +++ b/validation-test/compiler_crashers_2/be64bc4123212eee.swift @@ -0,0 +1,9 @@ +// {"kind":"typecheck","signature":"swift::constraints::RequirementFailure::RequirementFailure(swift::constraints::Solution const&, swift::Type, swift::Type, swift::constraints::ConstraintLocator*)","signatureAssert":"Assertion failed: (AffectedDecl), function RequirementFailure"} +// RUN: not --crash %target-swift-frontend -typecheck %s +protocol a + struct b = + } + b +.d diff --git a/validation-test/compiler_crashers_2_fixed/d815492a6398a52.swift b/validation-test/compiler_crashers_2_fixed/d815492a6398a52.swift new file mode 100644 index 0000000000000..babb435e2fe5e --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/d815492a6398a52.swift @@ -0,0 +1,15 @@ +// {"kind":"typecheck","original":"cc407c71","signature":"(anonymous namespace)::TypeSubstituter::transformOpaqueTypeArchetypeType(swift::OpaqueTypeArchetypeType*, swift::TypePosition)","stackOverflow":true} +// RUN: not %target-swift-frontend -typecheck %s +protocol a + @resultBuilder struct b { + static buildBlock(repeat each c) -> d + } + struct d