From 26b626c8cf68979e85938a45bd51e328c67275e7 Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Tue, 19 Dec 2023 12:05:48 +0100 Subject: [PATCH] [K/N][Tests] Add test for KT-64276 ^KT-64276 --- .../diagnostics/nativeTests/objCName.fir.kt | 11 ++++++++++ .../diagnostics/nativeTests/objCName.kt | 11 ++++++++++ .../diagnostics/nativeTests/objCName.txt | 22 +++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/compiler/testData/diagnostics/nativeTests/objCName.fir.kt b/compiler/testData/diagnostics/nativeTests/objCName.fir.kt index 77c604d9513..e9bffaa3b89 100644 --- a/compiler/testData/diagnostics/nativeTests/objCName.fir.kt +++ b/compiler/testData/diagnostics/nativeTests/objCName.fir.kt @@ -186,6 +186,17 @@ open class Derived2 : Derived() { override fun foo() {} } +interface I1 { + @ObjCName("foo1") + fun foo() +} + +interface DerivedI1 : I1 { + override fun foo() +} + +abstract class KT64276 : Base(), DerivedI1 {} + private const val exact = false private const val objcName = "nonLiteralArgsObjC" diff --git a/compiler/testData/diagnostics/nativeTests/objCName.kt b/compiler/testData/diagnostics/nativeTests/objCName.kt index ee544b11503..c3bba4d08b2 100644 --- a/compiler/testData/diagnostics/nativeTests/objCName.kt +++ b/compiler/testData/diagnostics/nativeTests/objCName.kt @@ -186,6 +186,17 @@ open class Derived2 : Derived() { override fun foo() {} } +interface I1 { + @ObjCName("foo1") + fun foo() +} + +interface DerivedI1 : I1 { + override fun foo() +} + +abstract class KT64276 : Base(), DerivedI1 {} + private const val exact = false private const val objcName = "nonLiteralArgsObjC" diff --git a/compiler/testData/diagnostics/nativeTests/objCName.txt b/compiler/testData/diagnostics/nativeTests/objCName.txt index d722426b5dc..f83fdc00cde 100644 --- a/compiler/testData/diagnostics/nativeTests/objCName.txt +++ b/compiler/testData/diagnostics/nativeTests/objCName.txt @@ -41,6 +41,13 @@ public open class Derived2 : Derived { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } +public interface DerivedI1 : I1 { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract override /*1*/ fun foo(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + @kotlin.native.ObjCName(exact = true, name = "ObjCEnumExactChecks") public final enum class EnumExactChecks : kotlin.Enum { @kotlin.native.ObjCName(exact = true, name = "objCEntryOne") enum entry ENTRY_ONE @@ -76,6 +83,21 @@ public interface I { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } +public interface I1 { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @kotlin.native.ObjCName(name = "foo1") public abstract fun foo(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public abstract class KT64276 : Base, DerivedI1 { + public constructor KT64276() + public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @kotlin.native.ObjCName(name = "foo1") public open override /*2*/ /*fake_override*/ fun foo(): kotlin.Unit + public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String +} + @kotlin.native.ObjCName(name = "ObjCClass", swiftName = "SwiftClass") public open class KotlinClass { public constructor KotlinClass() @kotlin.native.ObjCName(name = "objCProperty") public open var kotlinProperty: kotlin.Int