Skip to content

Commit f2c46b6

Browse files
committed
Add regression test for rdar://30832766, fixed by AnyObject removal
1 parent 8a1062d commit f2c46b6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/ClangImporter/objc_bridging_generics.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,11 @@ func getContainerForPanda() -> AnimalContainer<Animal> {
384384
func getContainerForFungiblePanda() -> FungibleAnimalContainer<Animal & Fungible> {
385385
return Panda.getFungibleContainer()
386386
}
387+
388+
// rdar://problem/30832766 - Infinite recursion while checking conformance
389+
// to AnyObject
390+
let third: Third! = Third()
391+
392+
func useThird() {
393+
_ = third.description
394+
}

test/Inputs/clang-importer-sdk/usr/include/objc_generics.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,14 @@ typedef id <Fungible> FungibleObject;
101101
+ (FungibleAnimalContainer *)getFungibleContainer;
102102

103103
@end
104+
105+
@interface First<__covariant T> : NSObject
106+
@end
107+
108+
@interface Second<__covariant T> : First<T>
109+
@end
110+
111+
@class Third;
112+
113+
@interface Third : Second<Third *>
114+
@end

0 commit comments

Comments
 (0)