mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
34 lines
683 B
Kotlin
Vendored
34 lines
683 B
Kotlin
Vendored
// LANGUAGE: +InlineClasses
|
|
// TARGET_BACKEND: JVM
|
|
// WITH_RUNTIME
|
|
|
|
// FILE: WithInlineClass.java
|
|
|
|
import kotlin.UInt;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
public class WithInlineClass {
|
|
@Nullable
|
|
public static UInt UINT = null;
|
|
|
|
public static void acceptsUInt(@Nullable UInt u) {
|
|
UINT = u;
|
|
}
|
|
|
|
@Nullable
|
|
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"
|
|
} |