[JS FIR] Add JsName clash test

^KT-64364
This commit is contained in:
Alexander Korepanov
2023-12-18 16:38:10 +01:00
committed by Space Team
parent 89e2af2047
commit 4609b11102
4 changed files with 54 additions and 0 deletions
@@ -0,0 +1,15 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// FIR_IDENTICAL
@file:JsExport
interface Optional<out T> {
@JsName("valueOrThrowException")
fun valueOrThrow(exp: Throwable): T
fun valueOrThrow(): T = valueOrThrow(NoSuchElementException("Optional has no value"))
}
abstract class None<out T : Any> private constructor() : Optional<T> {
companion object : None<Nothing>()
override fun valueOrThrow(exp: Throwable): Nothing = throw exp
}