Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/javaInterop/inlineClasInSignatureNonNull.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

34 lines
678 B
Kotlin
Vendored

// LANGUAGE: +InlineClasses
// TARGET_BACKEND: JVM
// WITH_STDLIB
// FILE: WithInlineClass.java
import kotlin.UInt;
import org.jetbrains.annotations.NotNull;
public class WithInlineClass {
@NotNull
public static UInt UINT = null;
public static void acceptsUInt(@NotNull UInt u) {
UINT = u;
}
@NotNull
public static UInt provideUInt() {
return UINT;
}
}
// FILE: box.kt
fun box(): String {
WithInlineClass.acceptsUInt(1u)
var res = WithInlineClass.provideUInt()
if (res != 1u) return "FAIL 1 $res"
WithInlineClass.UINT = 2u
res = WithInlineClass.UINT
if (res != 2u) return "FAIL 2 $res"
return "OK"
}