Files
kotlin-fork/compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt
T
Leonid Startsev 1932546a90 Support instantiation of annotations in JS
#KT-47700 Fixed
2021-09-01 11:13:55 +00:00

31 lines
647 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: WASM
// DONT_TARGET_EXACT_BACKEND: JS
// (supported: JVM_IR, JS_IR(_E6))
// WITH_RUNTIME
// !LANGUAGE: +InstantiationOfAnnotationClasses
// FILE: a.kt
package a
annotation class A(val i: Int)
fun createInOtherFile(): A = A(10)
// FILE: b.kt
import a.*
fun here(): A = A(10)
fun box(): String {
if (here() != createInOtherFile()) return "Fail equals"
if (here().hashCode() != createInOtherFile().hashCode()) return "Fail hashCode"
if (here().toString() != createInOtherFile().toString()) return "Fail toString"
return "OK"
}