File tree Expand file tree Collapse file tree 5 files changed +25
-17
lines changed
Inputs/clang-importer-sdk/usr/include/objc Expand file tree Collapse file tree 5 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -1906,6 +1906,12 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
1906
1906
return expr;
1907
1907
};
1908
1908
1909
+ auto maybeUnwrapConversions = [](Expr *expr) {
1910
+ if (auto *covariantReturn = dyn_cast<CovariantReturnConversionExpr>(expr))
1911
+ expr = covariantReturn->getSubExpr ();
1912
+ return expr;
1913
+ };
1914
+
1909
1915
switch (getThunkKind ()) {
1910
1916
case AutoClosureExpr::Kind::None:
1911
1917
case AutoClosureExpr::Kind::AsyncLet:
@@ -1916,6 +1922,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
1916
1922
body = body->getSemanticsProvidingExpr ();
1917
1923
body = maybeUnwrapOpenExistential (body);
1918
1924
body = maybeUnwrapOptionalEval (body);
1925
+ body = maybeUnwrapConversions (body);
1919
1926
1920
1927
if (auto *outerCall = dyn_cast<ApplyExpr>(body)) {
1921
1928
return outerCall->getFn ();
@@ -1934,6 +1941,7 @@ Expr *AutoClosureExpr::getUnwrappedCurryThunkExpr() const {
1934
1941
innerBody = innerBody->getSemanticsProvidingExpr ();
1935
1942
innerBody = maybeUnwrapOpenExistential (innerBody);
1936
1943
innerBody = maybeUnwrapOptionalEval (innerBody);
1944
+ innerBody = maybeUnwrapConversions (innerBody);
1937
1945
1938
1946
if (auto *outerCall = dyn_cast<ApplyExpr>(innerBody)) {
1939
1947
if (auto *innerCall = dyn_cast<ApplyExpr>(outerCall->getFn ())) {
Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ func ivars(_ hive: Hive) {
315
315
hive. queen. description ( ) // expected-error{{value of type 'Hive' has no member 'queen'}}
316
316
}
317
317
318
- class NSObjectable : NSObjectProtocol {
318
+ class NSObjectable : NSObjectProtocol { // expected-error {{cannot declare conformance to 'NSObjectProtocol' in Swift; 'NSObjectable' should inherit 'NSObject' instead}}
319
319
@objc var description : String { return " " }
320
320
@objc ( conformsToProtocol: ) func conforms( to _: Protocol ) -> Bool { return false }
321
321
@objc ( isKindOfClass: ) func isKind( of aClass: AnyClass ) -> Bool { return false }
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -enable-objc-interop -print-indexed-symbols -source-filename %s | %FileCheck %s
2
+ // REQUIRES: objc_interop
3
+
4
+ import Foundation
5
+
6
+ @objc
7
+ class Foo : NSObject {
8
+ // CHECK-DAG: constructor/Swift | init(object:)
9
+ init ( object: Any ? ) { }
10
+ }
11
+
12
+ extension Foo {
13
+ // CHECK-DAG: static-property/Swift | boom
14
+ static let boom = Foo ( object: self )
15
+ }
Original file line number Diff line number Diff line change 6
6
@class NSString ;
7
7
8
8
@protocol NSObject
9
+ - (instancetype )self ;
9
10
@property (readonly , copy ) NSString *description;
10
11
- (instancetype )retain OBJC_ARC_UNAVAILABLE;
11
12
- (Class )class ;
Original file line number Diff line number Diff line change @@ -113,22 +113,6 @@ class ClassWithCustomName2 {}
113
113
@objc ( CustomNameSub)
114
114
class ClassWithCustomNameSub : ClassWithCustomName { }
115
115
116
-
117
- // CHECK-LABEL: @interface ClassWithNSObjectProtocol <NSObject>
118
- // CHECK-NEXT: @property (nonatomic, readonly, copy) NSString * _Nonnull description;
119
- // CHECK-NEXT: - (BOOL)conformsToProtocol:(Protocol * _Nonnull)_ SWIFT_WARN_UNUSED_RESULT;
120
- // CHECK-NEXT: - (BOOL)isKindOfClass:(Class _Nonnull)aClass SWIFT_WARN_UNUSED_RESULT;
121
- // CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
122
- // CHECK-NEXT: @end
123
- @objc @objcMembers class ClassWithNSObjectProtocol : NSObjectProtocol {
124
- @objc var description : String { return " me " }
125
- @objc ( conformsToProtocol: )
126
- func conforms( to _: Protocol ) -> Bool { return false }
127
-
128
- @objc ( isKindOfClass: )
129
- func isKind( of aClass: AnyClass ) -> Bool { return false }
130
- }
131
-
132
116
// CHECK-LABEL: @interface DiscardableResult : NSObject
133
117
// CHECK-NEXT: - (NSInteger)nonDiscardable:(NSInteger)x SWIFT_WARN_UNUSED_RESULT;
134
118
// CHECK-NEXT: - (NSInteger)discardable:(NSInteger)x;
You can’t perform that action at this time.
0 commit comments