Files
swift-mirror/test/IDE/complete_func_no_closing_brace_deinit.swift
Ben Langmuir fe2c0db53b [code-completion] Fix completion when deinit shows up inside a local context
When braces are mismatched, we can have a deinit inside a function, so
ensure we don't crash in validateDecl.

rdar://problem/28867782
2016-11-11 11:41:08 -08:00

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 {}
}