mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #83689 from tshortli/rdar-158172056-test-case
Tests: Add a test for rdar://158172056
This commit is contained in:
@@ -1243,3 +1243,11 @@ void takeNullableId(_Nullable id);
|
||||
@interface PaletteDescriptor : NSObject <NSCopying>
|
||||
@property (readonly, nonnull) ColorArray *colors;
|
||||
@end
|
||||
|
||||
@protocol NSIndexable <NSObject>
|
||||
- (id)objectAtIndex:(NSInteger)index;
|
||||
@end
|
||||
|
||||
@interface NSCouldConformToIndexable : NSObject
|
||||
- (id)objectAtIndex:(NSInteger)index;
|
||||
@end
|
||||
|
||||
15
test/decl/protocol/conforms/objc_renamed.swift
Normal file
15
test/decl/protocol/conforms/objc_renamed.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
|
||||
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import Foundation
|
||||
|
||||
extension NSCouldConformToIndexable: @retroactive NSIndexable {
|
||||
}
|
||||
|
||||
extension NSCouldConformToIndexable {
|
||||
func testIndex(_ i: Int) {
|
||||
_ = objectAtIndex(i) // expected-error {{'objectAtIndex' has been renamed to 'object(at:)'}}
|
||||
_ = object(at: i)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user