[Tests] Cover rendering of diagnostic text by IR checker in

...`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT`.

^KT-62559
This commit is contained in:
Roman Efremov
2023-10-20 19:01:00 +02:00
committed by Space Team
parent 3297e6774f
commit 2b120f6cdc
7 changed files with 52 additions and 20 deletions
@@ -14,9 +14,9 @@ expect fun onType(): @Ann2("") Any?
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual annotation class Ann<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("Ann; Ann; Annotation `kotlin.annotation.Target` is missing on actual declaration")!>actual annotation class Ann<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun stringConcat() {}<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("stringConcat; stringConcat; Annotation `Ann2` is missing on actual declaration")!>actual fun stringConcat() {}<!>
// Not reported in K1, because supported starting from K2
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>actual fun onType(): Any? = null<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("onType; onType; Annotation `Ann2` is missing on actual declaration")!>actual fun onType(): Any? = null<!>
@@ -1,35 +1,35 @@
// -- Module: <m1-common> --
// -- Module: <m1-jvm> --
/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 <T> inTypeParam(): Unit defined in root package in file common.kt` must be present with the same arguments on actual `fun <T> inTypeParam(): Unit defined in root package in file jvm.kt`, otherwise they might behave incorrectly.
actual fun <T> 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 = ""
^
@@ -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 `<get-onGetter>` must be present with the same arguments on actual `<get-onGetter>`, 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.
@@ -1,4 +1,5 @@
// RENDER_DIAGNOSTICS_FULL_TEXT
// RENDER_IR_DIAGNOSTICS_FULL_TEXT
// MODULE: m1-common
// FILE: common.kt
@Target(
@@ -1,4 +1,5 @@
// RENDER_DIAGNOSTICS_FULL_TEXT
// RENDER_IR_DIAGNOSTICS_FULL_TEXT
// MODULE: m1-common
// FILE: common.kt
@Target(
@@ -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 <T> inTypeParam(): Unit' must be present with the same arguments on actual 'fun <T> 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.
@@ -1,4 +1,5 @@
// RENDER_DIAGNOSTICS_FULL_TEXT
// RENDER_IR_DIAGNOSTICS_FULL_TEXT
// MODULE: m1-common
// FILE: common.kt
@Target(