mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These two cases were previously timeout cases (infinite running time) and hence not included in validation-test/compiler_crashers/
14 lines
330 B
Swift
14 lines
330 B
Swift
// RUN: not --crash %target-swift-frontend %s -parse
|
|
// REQUIRES: asserts
|
|
|
|
// Distributed under the terms of the MIT license
|
|
// Test case found by https://github.com/robrix (Rob Rix)
|
|
// http://www.openradar.me/19924870
|
|
|
|
func unit<T>(x: T) -> T? {
|
|
return x
|
|
}
|
|
func f() -> Int? {
|
|
return unit(1) ?? unit(2).map { 1 } ?? nil
|
|
}
|