From 583606708204c8424ffd416c6c10cef83e5fa17f Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Fri, 9 Feb 2024 19:44:07 +0100 Subject: [PATCH] [klib] Add error suppression to a signature clash diagnostic test Currently, REDECLARATION is not reported if two conflicting declarations are in different source sets (KT-59898). However, when it's fixed, we want this test to keep testing the signature clash diagnostic, and not fail because of unexpected REDECLARATION error. --- .../klibSerializationTests/signatureClash_MPP.diag.txt | 8 ++++---- .../klibSerializationTests/signatureClash_MPP.kt | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt index 7785dbae3e2..3c000159e41 100644 --- a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.diag.txt @@ -1,9 +1,9 @@ Module: common -/common.kt:7:1: error: Platform declaration clash: The following functions have the same IR signature (/foo|foo(){}[0]): +/common.kt:8: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 -/common.kt:10:1: error: Platform declaration clash: The following functions have the same IR signature (/bar|bar(B){}[0]): +/common.kt:11: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 @@ -15,11 +15,11 @@ Module: common fun ``(): kotlin.Int defined in root package fun ``(): kotlin.Int defined in root package Module: platform -/platform.kt:17:1: error: Platform declaration clash: The following functions have the same IR signature (/foo|foo(){}[0]): +/platform.kt:18: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:21:1: error: Platform declaration clash: The following functions have the same IR signature (/bar|bar(B){}[0]): +/platform.kt:22: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 diff --git a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt index b1903f753c5..0e98bd6fe5e 100644 --- a/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt +++ b/compiler/testData/diagnostics/klibSerializationTests/signatureClash_MPP.kt @@ -1,4 +1,5 @@ // LANGUAGE: +MultiPlatformProjects +// DIAGNOSTICS: -ERROR_SUPPRESSION // FIR_IDENTICAL // RENDER_ALL_DIAGNOSTICS_FULL_TEXT @@ -9,8 +10,8 @@ expect class A fun bar(x: A): Int = 2 -// NOTE: This must be REDECLARATION, see KT-59898 -val param = 0 +@Suppress("REDECLARATION") +val param = 0 // MODULE: platform()()(common) // FILE: platform.kt @@ -20,5 +21,5 @@ class B actual typealias A = B fun bar(x: B): Int = 3 -// NOTE: This must be REDECLARATION, see KT-59898 -val param = 0 +@Suppress("REDECLARATION") +val param = 0