Files
kotlin-fork/compiler/testData/diagnostics/testsWithJvmBackend/multifileClasses/jvmSynthetic.kt
T
Alexander Udalov 6069aaee9c 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
2023-07-29 01:14:29 +02:00

35 lines
502 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_STDLIB
// FILE: f.kt
@file:JvmName("Foo")
<!NOT_ALL_MULTIFILE_CLASS_PARTS_ARE_JVM_SYNTHETIC!>@file:JvmMultifileClass<!>
package test
fun f() {}
// FILE: g.kt
@file:JvmName("Foo")
@file:JvmMultifileClass
@file:JvmSynthetic
package test
val g = ""
// FILE: h.kt
@file:JvmName("Foo")
<!NOT_ALL_MULTIFILE_CLASS_PARTS_ARE_JVM_SYNTHETIC!>@file:JvmMultifileClass<!>
package test
fun h() {}
// FILE: z.kt
@file:JvmName("Bar")
@file:JvmMultifileClass
package test
fun z() {}