File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1942,8 +1942,7 @@ static ForeignRepresentableKind getObjCObjectRepresentable(Type type) {
1942
1942
type = dynSelf->getSelfType ();
1943
1943
1944
1944
// @objc classes.
1945
- if (auto classType = type->getAs <ClassType>()) {
1946
- auto classDecl = classType->getDecl ();
1945
+ if (auto classDecl = type->getClassOrBoundGenericClass ()) {
1947
1946
auto &ctx = classDecl->getASTContext ();
1948
1947
if (auto resolver = ctx.getLazyResolver ())
1949
1948
resolver->resolveDeclSignature (classDecl);
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ func testImportedTypeParamRequirements() {
76
76
77
77
extension GenericClass {
78
78
func doesntUseGenericParam( ) { }
79
+ @objc func doesntUseGenericParam2( ) -> Self { }
80
+ // Doesn't technically use 'T', since it's type-erased at runtime
81
+ func doesntUseGenericParam3( ) -> GenericClass < T > { }
79
82
80
83
// expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}}
81
84
func usesGenericParamA( _ x: T ) { }
@@ -97,6 +100,9 @@ extension GenericClass {
97
100
}
98
101
99
102
static func doesntUseGenericParam( ) { }
103
+ static func doesntUseGenericParam2( ) -> Self { }
104
+ // Doesn't technically use 'T', since it's type-erased at runtime
105
+ static func doesntUseGenericParam3( ) -> GenericClass < T > { }
100
106
101
107
// expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}}
102
108
static func usesGenericParamA( _ x: T ) { }
@@ -116,4 +122,10 @@ extension GenericClass {
116
122
static func usesGenericParamF( _ x: Int ) {
117
123
_ = x is T
118
124
}
125
+
126
+ func checkThatMethodsAreObjC( ) {
127
+ _ = #selector( GenericClass . doesntUseGenericParam)
128
+ _ = #selector( GenericClass . doesntUseGenericParam2)
129
+ _ = #selector( GenericClass . doesntUseGenericParam3)
130
+ }
119
131
}
You can’t perform that action at this time.
0 commit comments