Skip to content

Add known type checker crashers. #4290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2016
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
3 changes: 3 additions & 0 deletions validation-test/Sema/type_checker_crashers/rdar27464577.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// RUN: not --crash %target-swift-frontend %s -parse

_ = [1].map { v -> T in return v as? Int }
7 changes: 7 additions & 0 deletions validation-test/Sema/type_checker_crashers/rdar27575060.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts

func f(_ x: Any...) {}

var a = 1
f((a, 2))
10 changes: 10 additions & 0 deletions validation-test/Sema/type_checker_crashers/rdar27680407.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: not --crash %target-swift-frontend %s -parse

struct rdar27680407 : ExpressibleByStringLiteral {
let value: String

// Stack overflow while validating rdar27680407.StringLiteralType.
init(stringLiteral value: rdar27680407.StringLiteralType) {
self.value = value
}
}
3 changes: 3 additions & 0 deletions validation-test/Sema/type_checker_crashers/rdar27787341.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// RUN: not --crash %target-swift-frontend %s -parse

_ = [1].reduce([:]) { $0[$1] }
13 changes: 13 additions & 0 deletions validation-test/Sema/type_checker_crashers/rdar27815848.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// RUN: not --crash %target-swift-frontend %s -parse

class C {}
class D : C {}

@_silgen_name("consume")
func consume(_: [C]) // note, returns ()

// Assert/crash while emitting diagnostic for coercion from () to Bool
// in the context of a collection cast.
func test(x: [D]) -> Bool {
return consume(x) // no way to coerce from () to Bool
}