Files
swift-mirror/test/IDE/complete_not_recommended.swift
Ben Langmuir 4a30637e08 [CodeCompletion] Don't complete unavailable methods in override
We generally don't want to override unavailable methods.  We already
filter out unavailable decls when completing values, but that's in a
separate visible decl consumer.

rdar://problem/25058233
2016-03-09 16:20:23 -08:00

26 lines
859 B
Swift

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER | FileCheck %s -check-prefix=CHECK1
// CHECK1: Begin completions, 2 items
// CHECK1: Decl[InstanceMethod]/CurrNominal: foo({#self: A#})[#() -> Void#]
// CHECK1: Decl[Constructor]/CurrNominal: init()[#A#]; name=init(){{$}}
// CHECK1: End completions
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERRIDE_1 | FileCheck %s -check-prefix=OVERRIDE_1
class A {
func foo() {}
@available(*, unavailable) func unavail() {}
}
func glob() {
A.#^MEMBER^#
}
class B : A {
override func #^OVERRIDE_1^#
// OVERRIDE_1: Begin completions
// OVERRIDE_1-NOT: Decl[InstanceMethod]
// OVERRIDE_1: Decl[InstanceMethod]/Super: foo() {|};
// OVERRIDE_1-NOT: Decl[InstanceMethod]
// OVERRIDE_1: End completions
}