Files
swift-mirror/test/decl/protocol/conforms/objc_renamed.swift
Allan Shortlidge bcc49cf708 Tests: Add a test for rdar://158172056.
The bug tracked by rdar://158172056 was already fixed by
https://github.com/swiftlang/swift/pull/83607 but this additional test case is
needed to ensure that conformances to Obj-C protocols with obsolete
requirements imported under legacy spellings not regress again.
2025-08-12 20:47:02 -07:00

16 lines
390 B
Swift

// 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)
}
}