K2: report JvmMultifileClass+JvmSynthetic error in JVM backend

Specifically, the case when not all parts of a multifile class are
annotated with `@JvmSynthetic`. Report the error on the
`@JvmMultifileClass` annotation instead of the package directive,
because the latter is difficult to find via IR. This fixes the test
FirLightTreeDiagnosticsTestWithJvmIrBackendGenerated.MultifileClasses.testJvmSynthetic.

 #KT-59586
This commit is contained in:
Alexander Udalov
2023-07-24 17:24:35 +02:00
parent 96ddd9bbf3
commit 6069aaee9c
3 changed files with 17 additions and 10 deletions
@@ -3,8 +3,8 @@
// FILE: f.kt
@file:JvmName("Foo")
@file:JvmMultifileClass
<!NOT_ALL_MULTIFILE_CLASS_PARTS_ARE_JVM_SYNTHETIC!>package test<!>
<!NOT_ALL_MULTIFILE_CLASS_PARTS_ARE_JVM_SYNTHETIC!>@file:JvmMultifileClass<!>
package test
fun f() {}
@@ -20,8 +20,8 @@ val g = ""
// FILE: h.kt
@file:JvmName("Foo")
@file:JvmMultifileClass
<!NOT_ALL_MULTIFILE_CLASS_PARTS_ARE_JVM_SYNTHETIC!>package test<!>
<!NOT_ALL_MULTIFILE_CLASS_PARTS_ARE_JVM_SYNTHETIC!>@file:JvmMultifileClass<!>
package test
fun h() {}