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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// {"kind":"complete","signature":"swift::constraints::ConstraintSystem::addConstraintImpl(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool)","signatureAssert":"Assertion failed: (second && \"Missing second type\"), function addConstraintImpl"}
// {"kind":"complete","signature":"swift::constraints::Constraint::Constraint(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocator*, llvm::SmallPtrSetImpl<swift::TypeVariableType*>&)","signatureAssert":"Assertion failed: (Ptr && \"Cannot dereference a null Type!\"), function operator->"}
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
@propertyWrapper struct a {
wrappedValue: Bool init(wrappedValue: Bool
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// {"kind":"complete","original":"70b8b689","signature":"swift::constraints::ConstraintSystem::addConstraintImpl(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool)","signatureAssert":"Assertion failed: (second && \"Missing second type\"), function addConstraintImpl"}
// RUN: not --crash %target-swift-ide-test -code-completion -batch-code-completion -skip-filecheck -code-completion-diagnostics -source-filename %s
@propertyWrapper struct a {
wrappedValue : Bool init(wrappedValue: Bool)
var projectedValue init(projectedValue:)
b(@a )
{
b(#^^#
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// {"kind":"complete","original":"febd2f61","signature":"swift::constraints::ConstraintSystem::matchFunctionTypes(swift::FunctionType*, swift::FunctionType*, swift::constraints::ConstraintKind, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder)","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
Optional#^^# = {
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// {"kind":"typecheck","signature":"(anonymous namespace)::ConnectedComponents::unionSets(swift::TypeVariableType*, swift::TypeVariableType*)","signatureAssert":"Assertion failed: (validComponentCount > 0), function unionSets"}
// RUN: not --crash %target-swift-frontend -typecheck %s
let b = (c(), d()
a {
e
b

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// {"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
return {
lazy var a = if .random() { return }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// {"kind":"typecheck","original":"6bf5a596","signature":"(anonymous namespace)::DeclChecker::visit(swift::Decl*)","signatureAssert":"Assertion failed: (Val && \"isa<> used on a null pointer\"), function doit"}
// RUN: not --crash %target-swift-frontend -typecheck %s
@implementation
extension
CInt
{
deinit {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// {"kind":"typecheck","signature":"(anonymous namespace)::ExprRewriter::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocatorBuilder)"}
// RUN: not --crash %target-swift-frontend -typecheck %s
struct a {
callAsFunction( () -> Void)
_ = a. init {
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// {"kind":"typecheck","signature":"(anonymous namespace)::ExprRewriter::visitDeclRefExpr(swift::DeclRefExpr*)"}
// RUN: not --crash %target-swift-frontend -typecheck %s
{
for b 0..<0 {
let a = Array(0..<b)
for c d a {
for e d c... {
Array(a[c..<e].reversed())
f(
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// {"kind":"typecheck","signature":"swift::PackType::getExpandedGenericArgs(llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Type>)","signatureAssert":"Assertion failed: (isa<To>(Val) && \"cast<Ty>() argument of incompatible type!\"), function cast"}
// RUN: not --crash %target-swift-frontend -typecheck %s
struct a<each b
typealias c<each d> = a<>
c<(
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// {"kind":"typecheck","original":"134d8fc1","signature":"swift::Parser::parseCustomAttribute(swift::SourceLoc)","signatureAssert":"Assertion failed: (Tok.is(tok::identifier)), function parseCustomAttribute"}
// RUN: not --crash %target-swift-frontend -typecheck %s
@ @ ::
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// {"kind":"typecheck","original":"21bee1da","signature":"swift::Parser::parseExprEditorPlaceholder(swift::Token, swift::Identifier)","signatureAssert":"Assertion failed: (PlaceholderId.isEditorPlaceholder()), function parseExprEditorPlaceholder"}
// RUN: not --crash %target-swift-frontend -typecheck %s
<##>::
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// {"kind":"typecheck","original":"fec80ed5","signature":"swift::TypeChecker::typeCheckParameterDefault(swift::Expr*&, swift::DeclContext*, swift::Type, bool, bool)","signatureAssert":"Assertion failed: (paramType && (!paramType->hasError() || DC->getASTContext().CompletionCallback)), function typeCheckParameterDefault"}
// RUN: not --crash %target-swift-frontend -typecheck %s
func a {
return switch 0 {
case /fallthrough
fatalError(
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// {"kind":"typecheck","signature":"swift::TypeChecker::typeCheckStmtConditionElement(swift::StmtConditionElement&, bool&, swift::DeclContext*)","signatureAssert":"Assertion failed: (!elt.getPattern()->hasType() && \"the pattern binding condition is already type checked\"), function typeCheckPatternBindingStmtConditionElement"}
// RUN: not --crash %target-swift-frontend -typecheck %s
struct a {
func b() {}
}
_ = { c }
var d: a?
guard let d else {}
let c = d.b()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// {"issueID":85266,"kind":"emit-silgen","signature":"swift::Lowering::TypeConverter::setCaptureTypeExpansionContext(swift::SILDeclRef, swift::SILModule&)","signatureAssert":"Assertion failed: (existing->second == context && \"closure shouldn't be emitted with different capture type expansion contexts\"), function setCaptureTypeExpansionContext"}
// RUN: not --crash %target-swift-frontend -emit-silgen %s
// https://github.com/swiftlang/swift/issues/85266
func a() {
func b() -> Any {
c
}
lazy var c = b
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// {"kind":"typecheck","original":"e51afbca","signature":"diagnoseContextualFunctionCallGenericAmbiguity(swift::constraints::ConstraintSystem&, llvm::ArrayRef<std::__1::pair<swift::constraints::Solution const*, swift::constraints::ConstraintFix const*>>, llvm::ArrayRef<std::__1::pair<swift::constraints::Solution const*, swift::constraints::ConstraintFix const*>>)","signatureAssert":"Assertion failed: (!empty()), function front"}
// RUN: not --crash %target-swift-frontend -typecheck %s
struct a throw withThrowingTaskGroup(of : a) {
b in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// {"kind":"emit-silgen","signature":"swift::getDistributedActorSystemResultHandlerType(swift::NominalTypeDecl*)","signatureAssert":"Assertion failed: (!system->isDistributedActor()), function getDistributedActorSystemResultHandlerType"}
// RUN: not --crash %target-swift-frontend -emit-silgen %s
// REQUIRES: OS=macosx
import Distributed
distributed actor a: DistributedActorSystem {
}
6 changes: 6 additions & 0 deletions validation-test/compiler_crashers/getParameterAt-020583.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// {"kind":"typecheck","original":"b56d8c69","signature":"swift::getParameterAt(swift::ConcreteDeclRef, unsigned int)"}
// RUN: not --crash %target-swift-frontend -typecheck %s
{
func a()
@<#type#> #b(a(c))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// {"kind":"typecheck","original":"c9d8f598","signature":"getPropertyWrapperTypeFromOverload(swift::constraints::ConstraintSystem&, swift::constraints::SelectedOverload, llvm::function_ref<swift::VarDecl* (swift::VarDecl*)>)","signatureAssert":"Assertion failed: (!cs.hasType(D) && \"Should have recorded type for wrapper var\"), function getPropertyWrapperTypeFromOverload"}
// RUN: not --crash %target-swift-frontend -typecheck %s
@propertyWrapper struct a {
wrappedValue : Bool init(wrappedValue: Bool)
var projectedValue
init(projectedValue: Bool)
func b(@a c: Bool) {
b - c
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// {"kind":"typecheck","original":"e679747c","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
// RUN: not %target-swift-frontend -typecheck %s
enum a<b>: Error {
case c(
}
struct d {
bar( Error? -> Void)
{
bar {
e in
return if let a<Int>.c(f) = e {
f
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// {"kind":"typecheck","original":"deecafdd","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
// RUN: not %target-swift-frontend -typecheck %s
return {
lazy var a = <#expression#>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// {"kind":"typecheck","original":"1309b52b","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
// RUN: not %target-swift-frontend -typecheck %s
{
let a = 0.0
switch a {
case let !b where b:
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// {"kind":"typecheck","original":"22c204bc","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
// RUN: not %target-swift-frontend -typecheck %s
struct a: ExpressibleByIntegerLiteral
func *** (a , a )
}
{
let b = 3 *** 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// {"kind":"typecheck","original":"18f513af","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
// RUN: not %target-swift-frontend -typecheck %s
{
guard let a = a "