mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When braces are mismatched, we can have a deinit inside a function, so ensure we don't crash in validateDecl. rdar://problem/28867782
17 lines
428 B
Swift
17 lines
428 B
Swift
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=A | %FileCheck %s
|
|
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=B | %FileCheck %s
|
|
// CHECK: Decl[InstanceMethod]/CurrNominal: f()[#Void#]{{; name=.+$}}
|
|
class C1 {
|
|
func f() {
|
|
#^A^#
|
|
deinit {}
|
|
}
|
|
|
|
class C2 {
|
|
func f() {
|
|
guard let x = Optional(1) else {
|
|
#^B^#
|
|
}
|
|
deinit {}
|
|
}
|