From 2b120f6cdce7ce16322dc153000ffcd23935ddb8 Mon Sep 17 00:00:00 2001 From: Roman Efremov Date: Fri, 20 Oct 2023 19:01:00 +0200 Subject: [PATCH] [Tests] Cover rendering of diagnostic text by IR checker in ...`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT`. ^KT-62559 --- .../annotationArgRendering.fir.kt | 6 ++-- .../checkDiagnosticFullText.diag.txt | 16 +++++----- .../checkDiagnosticFullText.fir.ir.diag.txt | 29 +++++++++++++++++++ .../checkDiagnosticFullText.fir.kt | 1 + .../checkDiagnosticFullText.kt | 1 + .../checkDiagnosticFullText.ll.fir.diag.txt | 18 ++++++------ .../checkDiagnosticFullText.ll.kt | 1 + 7 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.ir.diag.txt diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt index 2e00d32639c..6b619cc7724 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/annotationArgRendering.fir.kt @@ -14,9 +14,9 @@ expect fun onType(): @Ann2("") Any? // MODULE: m1-jvm()()(m1-common) // FILE: jvm.kt -actual annotation class Ann +actual annotation class Ann -actual fun stringConcat() {} +actual fun stringConcat() {} // Not reported in K1, because supported starting from K2 -actual fun onType(): Any? = null +actual fun onType(): Any? = null diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.diag.txt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.diag.txt index cc6557e8733..1a1a2e2dbf8 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.diag.txt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.diag.txt @@ -1,35 +1,35 @@ // -- Module: -- // -- Module: -- -/jvm.kt:47:14: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:48:14: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `class OnClass defined in root package in file common.kt` must be present with the same arguments on actual `class OnClass defined in root package in file jvm.kt`, otherwise they might behave incorrectly. actual class OnClass ^ -/jvm.kt:50:16: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:51:16: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `fun onMember(): Unit defined in OnMember` must be present with the same arguments on actual `fun onMember(): Unit defined in OnMember`, otherwise they might behave incorrectly. actual fun onMember() {} ^ -/jvm.kt:55:18: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:56:18: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `class ViaTypealias defined in root package in file common.kt` must be present with the same arguments on actual `class ViaTypealiasImpl defined in root package in file jvm.kt`, otherwise they might behave incorrectly. actual typealias ViaTypealias = ViaTypealiasImpl ^ -/jvm.kt:60:18: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:61:18: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `fun foo(): Unit defined in MemberScopeViaTypealias` must be present with the same arguments on actual `fun foo(): Unit defined in MemberScopeViaTypealiasImpl`, otherwise they might behave incorrectly. actual typealias MemberScopeViaTypealias = MemberScopeViaTypealiasImpl ^ -/jvm.kt:63:12: warning: annotation `@WithArg(s = "str")` has different arguments on actual declaration: `@WithArg(s = "other str")`. +/jvm.kt:64:12: warning: annotation `@WithArg(s = "str")` has different arguments on actual declaration: `@WithArg(s = "other str")`. All annotations from expect `fun withDifferentArg(): Unit defined in root package in file common.kt` must be present with the same arguments on actual `fun withDifferentArg(): Unit defined in root package in file jvm.kt`, otherwise they might behave incorrectly. actual fun withDifferentArg() {} ^ -/jvm.kt:65:12: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:66:12: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `fun inValueParam(arg: String): Unit defined in root package in file common.kt` must be present with the same arguments on actual `fun inValueParam(arg: String): Unit defined in root package in file jvm.kt`, otherwise they might behave incorrectly. actual fun inValueParam(arg: String) {} ^ -/jvm.kt:67:16: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:68:16: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `fun inTypeParam(): Unit defined in root package in file common.kt` must be present with the same arguments on actual `fun inTypeParam(): Unit defined in root package in file jvm.kt`, otherwise they might behave incorrectly. actual fun inTypeParam() {} ^ -/jvm.kt:69:12: warning: annotation `@Ann` is missing on actual declaration. +/jvm.kt:70:12: warning: annotation `@Ann` is missing on actual declaration. All annotations from expect `val onGetter: String defined in root package in file common.kt` must be present with the same arguments on actual `val onGetter: String defined in root package in file jvm.kt`, otherwise they might behave incorrectly. actual val onGetter: String = "" ^ diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.ir.diag.txt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.ir.diag.txt new file mode 100644 index 00000000000..2b6212af002 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.ir.diag.txt @@ -0,0 +1,29 @@ +/jvm.kt:(94,114): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `OnClass` must be present with the same arguments on actual `OnClass`, otherwise they might behave incorrectly. + +/jvm.kt:(144,168): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `OnMember.onMember` must be present with the same arguments on actual `OnMember.onMember`, otherwise they might behave incorrectly. + +/jvm.kt:(196,244): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `ViaTypealias` must be present with the same arguments on actual `ViaTypealiasImpl`, otherwise they might behave incorrectly. + +/jvm.kt:(301,371): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `MemberScopeViaTypealias.foo` must be present with the same arguments on actual `MemberScopeViaTypealiasImpl.foo`, otherwise they might behave incorrectly. + +/jvm.kt:(373,427): warning: Annotation `WithArg` has different arguments on actual declaration. +All annotations from expect `withDifferentArg` must be present with the same arguments on actual `withDifferentArg`, otherwise they might behave incorrectly. + +/jvm.kt:(429,468): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `inValueParam` must be present with the same arguments on actual `inValueParam`, otherwise they might behave incorrectly. + +/jvm.kt:(470,501): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `inTypeParam` must be present with the same arguments on actual `inTypeParam`, otherwise they might behave incorrectly. + +/jvm.kt:(503,535): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `onGetter` must be present with the same arguments on actual `onGetter`, otherwise they might behave incorrectly. + +/jvm.kt:(503,535): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `` must be present with the same arguments on actual ``, otherwise they might behave incorrectly. + +/jvm.kt:(537,569): warning: Annotation `Ann` is missing on actual declaration. +All annotations from expect `onType` must be present with the same arguments on actual `onType`, otherwise they might behave incorrectly. diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt index f0cb82d293d..d76007eb6b5 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.fir.kt @@ -1,4 +1,5 @@ // RENDER_DIAGNOSTICS_FULL_TEXT +// RENDER_IR_DIAGNOSTICS_FULL_TEXT // MODULE: m1-common // FILE: common.kt @Target( diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.kt index 49f8a5457da..b8ad9106b28 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.kt @@ -1,4 +1,5 @@ // RENDER_DIAGNOSTICS_FULL_TEXT +// RENDER_IR_DIAGNOSTICS_FULL_TEXT // MODULE: m1-common // FILE: common.kt @Target( diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.fir.diag.txt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.fir.diag.txt index 65032dfacd0..08d843c8093 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.fir.diag.txt @@ -1,26 +1,26 @@ -/jvm.kt:(106,113): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(107,114): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'class OnClass : Any' must be present with the same arguments on actual 'class OnClass : Any', otherwise they might behave incorrectly. -/jvm.kt:(154,162): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(155,163): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'fun onMember(): Unit' must be present with the same arguments on actual 'fun onMember(): Unit', otherwise they might behave incorrectly. -/jvm.kt:(212,224): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(213,225): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'class ViaTypealias : Any' must be present with the same arguments on actual 'class ViaTypealiasImpl : Any', otherwise they might behave incorrectly. -/jvm.kt:(317,340): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(318,341): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'fun foo(): Unit' must be present with the same arguments on actual 'fun foo(): Unit', otherwise they might behave incorrectly. -/jvm.kt:(405,421): warning: Annotation `@WithArg(s = String(str))` has different arguments on actual declaration: `@WithArg(s = String(other str))`. +/jvm.kt:(406,422): warning: Annotation `@WithArg(s = String(str))` has different arguments on actual declaration: `@WithArg(s = String(other str))`. All annotations from expect 'fun withDifferentArg(): Unit' must be present with the same arguments on actual 'fun withDifferentArg(): Unit', otherwise they might behave incorrectly. -/jvm.kt:(439,451): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(440,452): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'fun inValueParam(arg: String): Unit' must be present with the same arguments on actual 'fun inValueParam(arg: String): Unit', otherwise they might behave incorrectly. -/jvm.kt:(484,495): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(485,496): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'fun inTypeParam(): Unit' must be present with the same arguments on actual 'fun inTypeParam(): Unit', otherwise they might behave incorrectly. -/jvm.kt:(513,521): warning: Annotation `@PROPERTY_GETTER:Ann()` is missing on actual declaration. +/jvm.kt:(514,522): warning: Annotation `@PROPERTY_GETTER:Ann()` is missing on actual declaration. All annotations from expect 'val onGetter: String get(): String' must be present with the same arguments on actual 'val onGetter: String get(): String', otherwise they might behave incorrectly. -/jvm.kt:(547,553): warning: Annotation `@Ann()` is missing on actual declaration. +/jvm.kt:(548,554): warning: Annotation `@Ann()` is missing on actual declaration. All annotations from expect 'fun onType(param: @Ann() Any): Unit' must be present with the same arguments on actual 'fun onType(param: Any): Unit', otherwise they might behave incorrectly. diff --git a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.kt b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.kt index 9f74c49b76c..2f87d155adb 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/actualAnnotationsNotMatchExpect/checkDiagnosticFullText.ll.kt @@ -1,4 +1,5 @@ // RENDER_DIAGNOSTICS_FULL_TEXT +// RENDER_IR_DIAGNOSTICS_FULL_TEXT // MODULE: m1-common // FILE: common.kt @Target(