From 0c0943a880d9948993de7ba764446fc3ac65180b Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Thu, 8 Feb 2024 21:25:06 +0100 Subject: [PATCH] [klib] Add a test for KT-65551 --- .../signatureClash_MPP.diag.txt | 28 +++++++++++++++++-- .../signatureClash_MPP.kt | 6 ++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt index cf5a3d06afd..f280f0041d1 100644 --- a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt @@ -6,11 +6,35 @@ Module: common /common.kt:10:1: error: Platform declaration clash: The following functions have the same IR signature (/bar|bar(B){}[0]): fun bar(x: B): kotlin.Int defined in root package fun bar(x: B): kotlin.Int defined in root package + +/common.kt:13:1: error: Platform declaration clash: The following properties have the same IR signature (/param|{}param[0]): + val param: kotlin.Int defined in root package + val param: kotlin.Int defined in root package + +/common.kt:13:1: error: Platform declaration clash: The following fields have the same IR signature ([ /param|{}param[0] <- Local[|FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private [final,static]] ]): + val param: kotlin.Int defined in root package + val param: kotlin.Int defined in root package + +/common.kt:13:1: error: Platform declaration clash: The following functions have the same IR signature (/param.|(){}[0]): + fun ``(): kotlin.Int defined in root package + fun ``(): kotlin.Int defined in root package Module: platform -/platform.kt:14:1: error: Platform declaration clash: The following functions have the same IR signature (/foo|foo(){}[0]): +/platform.kt:17:1: error: Platform declaration clash: The following functions have the same IR signature (/foo|foo(){}[0]): fun foo(): kotlin.Int defined in root package fun foo(): kotlin.String defined in root package -/platform.kt:18:1: error: Platform declaration clash: The following functions have the same IR signature (/bar|bar(B){}[0]): +/platform.kt:21:1: error: Platform declaration clash: The following functions have the same IR signature (/bar|bar(B){}[0]): fun bar(x: B): kotlin.Int defined in root package fun bar(x: B): kotlin.Int defined in root package + +/platform.kt:24:1: error: Platform declaration clash: The following properties have the same IR signature (/param|{}param[0]): + val param: kotlin.Int defined in root package + val param: kotlin.Int defined in root package + +/platform.kt:24:1: error: Platform declaration clash: The following fields have the same IR signature ([ /param|{}param[0] <- Local[|FIELD PROPERTY_BACKING_FIELD name:param type:kotlin.Int visibility:private [final,static]] ]): + val param: kotlin.Int defined in root package + val param: kotlin.Int defined in root package + +/platform.kt:24:1: error: Platform declaration clash: The following functions have the same IR signature (/param.|(){}[0]): + fun ``(): kotlin.Int defined in root package + fun ``(): kotlin.Int defined in root package diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt index 6aec4e90443..cc0c068406d 100644 --- a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt @@ -9,6 +9,9 @@ expect class A fun bar(x: A): Int = 2 +// NOTE: This must be REDECLARATION, see KT-59898 +val param = 0 + // MODULE: platform()()(common) // FILE: platform.kt fun foo(): Int = 0 @@ -16,3 +19,6 @@ expect class A class B actual typealias A = B fun bar(x: B): Int = 3 + +// NOTE: This must be REDECLARATION, see KT-59898 +val param = 0