Skip to content

Commit d095796

Browse files
authored
Merge pull request #83689 from tshortli/rdar-158172056-test-case
Tests: Add a test for rdar://158172056
2 parents 162df1d + bcc49cf commit d095796

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,3 +1243,11 @@ void takeNullableId(_Nullable id);
12431243
@interface PaletteDescriptor : NSObject <NSCopying>
12441244
@property (readonly, nonnull) ColorArray *colors;
12451245
@end
1246+
1247+
@protocol NSIndexable <NSObject>
1248+
- (id)objectAtIndex:(NSInteger)index;
1249+
@end
1250+
1251+
@interface NSCouldConformToIndexable : NSObject
1252+
- (id)objectAtIndex:(NSInteger)index;
1253+
@end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
2+
3+
// REQUIRES: objc_interop
4+
5+
import Foundation
6+
7+
extension NSCouldConformToIndexable: @retroactive NSIndexable {
8+
}
9+
10+
extension NSCouldConformToIndexable {
11+
func testIndex(_ i: Int) {
12+
_ = objectAtIndex(i) // expected-error {{'objectAtIndex' has been renamed to 'object(at:)'}}
13+
_ = object(at: i)
14+
}
15+
}

0 commit comments

Comments
 (0)