Add 5 compiler crashes (+ 1 fixed crash).
This commit is contained in:
practicalswift
2015-12-11 21:35:06 +01:00
parent 689db17800
commit fe2bc2421e
6 changed files with 3966 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
// RUN: not --crash %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/zneak (zneak)
protocol A { typealias B }
class C : A { typealias B = Int }
func crash<D: C>() -> Bool {
let a: D.B? = nil
}

View File

@@ -0,0 +1,13 @@
// RUN: not --crash %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/austinzheng (Austin Zheng)
enum A<T> {
case Just(T)
case Error
}
func foo() -> A<(String, String?)> {
return A.Just("abc", "def")
}

View File

@@ -0,0 +1,14 @@
// RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: objc_interop
// Distributed under the terms of the MIT license
// Test case found by https://github.com/benshan (Ben Shanfelder)
import Foundation
extension NSObject {
var handler: Int {
// FIXME: Crashing due to lack of get {}
set {}
}
}

View File

@@ -0,0 +1,15 @@
// RUN: not %target-swift-frontend %s -parse
// rdar://22007370
class Foo {
subscript(key: String) -> String {
get { a }
set { b }
}
subscript(key: String) -> String {
get { a }
set { b }
}
}