mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We have to handle undef partial_apply arguments to handle the following
source gracefully during the diagnosis pipeline.
```
class TestUndefined {
private var stringList: [String]!
func dontCrash(strings: [String]) {
assert(stringList.allSatisfy({ $0 == stringList.first!}))
let stringList = strings.filter({ $0 == "a" })
}
}
```
rdar://57893008
14 lines
402 B
Swift
14 lines
402 B
Swift
// RUN: not %target-swift-frontend %s -sil-verify-all -c 2>&1 | %FileCheck %s
|
|
|
|
// Report the error but don't crash.
|
|
// CHECK: error: closure captures 'stringList' before it is declared
|
|
|
|
class TestUndefined {
|
|
private var stringList: [String]!
|
|
|
|
func dontCrash(strings: [String]) {
|
|
assert(stringList.allSatisfy({ $0 == stringList.first!}))
|
|
let stringList = strings.filter({ $0 == "a" })
|
|
}
|
|
}
|