From fa897e4148caaa3bfad747d7eed946e20d0bac7b Mon Sep 17 00:00:00 2001 From: Roman Efremov Date: Fri, 20 Oct 2023 20:36:07 +0200 Subject: [PATCH] [Tests] Cover rendering of KClass annotation args in ...`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT`. ^KT-62559 --- .../annotationArgRendering.fir.kt | 7 +++++++ .../annotationArgRendering.kt | 7 +++++++ .../annotationArgRendering.ll.kt | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt index 6b619cc7724..b96046cbf82 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt @@ -12,6 +12,11 @@ expect fun stringConcat() expect fun onType(): @Ann2("") Any? +annotation class Ann3(val kclass: kotlin.reflect.KClass<*>) + +@Ann3(String::class) +expect fun kclassArg() + // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt actual annotation class Ann @@ -20,3 +25,5 @@ expect fun onType(): @Ann2("") Any? // Not reported in K1, because supported starting from K2 actual fun onType(): Any? = null + +actual fun kclassArg() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.kt index 84c0d3788de..d536885225b 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.kt @@ -12,6 +12,11 @@ expect fun stringConcat() expect fun onType(): @Ann2("") Any? +annotation class Ann3(val kclass: kotlin.reflect.KClass<*>) + +@Ann3(String::class) +expect fun kclassArg() + // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt actual annotation class Ann @@ -20,3 +25,5 @@ actual fun kclassArg() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.ll.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.ll.kt index a9cd53ca787..55389097b91 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.ll.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.ll.kt @@ -12,6 +12,11 @@ expect fun stringConcat() expect fun onType(): @Ann2("") Any? +annotation class Ann3(val kclass: kotlin.reflect.KClass<*>) + +@Ann3(String::class) +expect fun kclassArg() + // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt actual annotation class Ann @@ -20,3 +25,5 @@ actual fun onType(): Any? = null + +actual fun (String))` is missing on actual declaration")!>kclassArg() {}