(void)(int)[[test0 unknownMethod] otherUnknownMethod];;
(void)(id)[[test1() unknownMethod] otherUnknownMethod];
}
-// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s
-
-extern __unknown_anytype test0;
-extern __unknown_anytype test1();
-
-void test_unknown_anytype_receiver() {
- (void)(int)[[test0 unknownMethod] otherUnknownMethod];;
- (void)(id)[[test1() unknownMethod] otherUnknownMethod];
-}
-// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s
-
-extern __unknown_anytype test0;
-extern __unknown_anytype test1();
-
-void test_unknown_anytype_receiver() {
- (void)(int)[[test0 unknownMethod] otherUnknownMethod];;
- (void)(id)[[test1() unknownMethod] otherUnknownMethod];
-}
--- /dev/null
+// RUN: %clang_cc1 -fdebugger-support -fdebugger-cast-result-to-id -funknown-anytype -fsyntax-only -verify %s
+
+// rdar://problem/9416370
+namespace test0 {
+ void test(id x) {
+ if ([x foo]) {} // expected-error {{no known method '-foo'; cast the message send to the method's return type}}
+ [x foo];
+ }
+}