mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
13 lines
276 B
Swift
13 lines
276 B
Swift
// RUN: not --crash %target-swift-frontend %s -parse
|
|
// REQUIRES: asserts
|
|
|
|
// Issue 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
|
|
}
|