summaryrefslogtreecommitdiff
path: root/test/CodeCompletion
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2016-10-12 11:40:15 +0000
committerAlex Lorenz <arphaman@gmail.com>2016-10-12 11:40:15 +0000
commit86f83e0e3aa25579635770318b7344834be4bb6b (patch)
tree74adbb8c4536d817f4f355ef444397db64d85b5a /test/CodeCompletion
parent38df4e8d58547a691318935bb7d1d4be41e9803c (diff)
[CodeCompletion] Show protocol properties that are accessed through qualified id
This commit improves code completion for properties that are declared in Objective-C protocols by making sure that properties show up in completions when they are accessed through a qualified id. rdar://24426041 Differential Revision: https://reviews.llvm.org/D25436 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion')
-rw-r--r--test/CodeCompletion/objc-protocol-member-access.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeCompletion/objc-protocol-member-access.m b/test/CodeCompletion/objc-protocol-member-access.m
new file mode 100644
index 0000000000..0ed55387e3
--- /dev/null
+++ b/test/CodeCompletion/objc-protocol-member-access.m
@@ -0,0 +1,24 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+@protocol Bar
+@property (readonly) int bar;
+@end
+
+@protocol Foo <Bar>
+
+@property (nonatomic, readonly) int foo;
+- (void)foobar: (int)x;
+
+@end
+
+int getFoo(id object) {
+ id<Foo> modelObject = (id<Foo>)object;
+ int foo = modelObject.;
+ return foo;
+}
+
+// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:17:25 %s -o - | FileCheck %s
+// CHECK: bar : [#int#]bar
+// CHECK: foo : [#int#]foo
+// CHECK-NOT: foobar