From 75665655cb6f6a0d266321874fea82fbe834e33f Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Thu, 26 Sep 2024 09:34:28 +0200 Subject: [PATCH] [Native][tests] Add ExperimentalForeignApi opt-in for failing test ^KT-71333 --- .../nativeTests/specialBackendChecks/objCInterop/t17.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt index 73461e38522c4..2db2b05167972 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt @@ -1,9 +1,17 @@ // FIR_IDENTICAL // WITH_PLATFORM_LIBS +import kotlinx.cinterop.ExperimentalForeignApi import platform.darwin.* import platform.Foundation.* class Foo : NSObject(), NSPortDelegateProtocol { + @OptIn(ExperimentalForeignApi::class) + // ^^^ Added opt-in because of the difference in NSPortDelegateProtocol.handlePortMessage() signature + // on different platforms. On some targets, the signature uses experimental C-interop API. + // + // Examples: + // macos_arm64: public open fun handlePortMessage(message: platform.Foundation.NSPortMessage) + // ios_simulator_arm64: public open fun handlePortMessage(message: objcnames.classes.NSPortMessage) fun foo() { super.handlePortMessage(TODO()) }