Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/result.kt
T
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00

24 lines
814 B
Kotlin
Vendored

// In this test, stdlib class `public value class Result<out T>` within `kotlin` package is replaced with a custom non-generic class
// NATIVE exception: java.util.NoSuchElementException: Collection contains no element matching the predicate
// during `KonanSymbols.kotlinResultGetOrThrow`, since function `Result<T>.getOrThrow()` within `kotlin` package cannot be found during builtins construction,
// since unbound class `Result` is expected, but deserialized one found.
// DONT_TARGET_EXACT_BACKEND: NATIVE
// IGNORE_BACKEND: ANDROID
// ALLOW_KOTLIN_PACKAGE
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
// FILE: result.kt
package kotlin
OPTIONAL_JVM_INLINE_ANNOTATION
value class Result(val value: Any?)
// FILE: box.kt
fun box(): String {
return Result("OK").value as String
}