[IR] Print annotation arguments in report of ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT

Now IR checker is not duplicated by FIR checker reporting, so it's
useful to have more verbose report of annotations in diagnostic message.

^KT-62559
This commit is contained in:
Roman Efremov
2023-11-23 13:49:59 +01:00
committed by Space Team
parent ec7a2c20d1
commit 8f6b6e17be
5 changed files with 59 additions and 18 deletions
@@ -19,11 +19,11 @@ expect fun kclassArg()
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
<!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("Ann; Ann; Annotation `@Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.CLASS])` is missing on actual declaration")!>actual annotation class Ann<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("stringConcat; stringConcat; Annotation `Ann2` is missing on actual declaration")!>actual fun stringConcat() {}<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("stringConcat; stringConcat; Annotation `@Ann2(s = '12')` is missing on actual declaration")!>actual fun stringConcat() {}<!>
// Not reported in K1, because supported starting from K2
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("onType; onType; Annotation `Ann2` is missing on actual declaration")!>actual fun onType(): Any? = null<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("onType; onType; Annotation `@Ann2(s = '')` is missing on actual declaration")!>actual fun onType(): Any? = null<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("kclassArg; kclassArg; Annotation `Ann3` is missing on actual declaration")!>actual fun kclassArg() {}<!>
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT("kclassArg; kclassArg; Annotation `@Ann3(kclass = String::class)` is missing on actual declaration")!>actual fun kclassArg() {}<!>
@@ -1,26 +1,26 @@
/jvm.kt:(94,114): warning: Annotation `Ann` is missing on actual declaration.
/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.
/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.
/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.
/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.
/jvm.kt:(373,427): warning: Annotation `@WithArg(s = 'str')` has different arguments on actual declaration: `@WithArg(s = 'other str')`.
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.
/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.
/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.
/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.
/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.