Files
kotlin-fork/compiler/testData/codegen/box/signatureAnnotations/defaultLongLiteral.kt
T
2018-06-28 12:26:41 +02:00

50 lines
861 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// FILE: A.java
// ANDROID_ANNOTATIONS
import kotlin.annotations.jvm.internal.*;
public class A {
public Long first(@DefaultValue("0x1F") Long value) {
return value;
}
public Long second(@DefaultValue("0X1F") Long value) {
return value;
}
public Long third(@DefaultValue("0b1010") Long value) {
return value;
}
public Long fourth(@DefaultValue("0B1010") Long value) {
return value;
}
}
// FILE: test.kt
fun box(): String {
val a = A()
if (a.first() != 0x1F.toLong()) {
return "FAIL 1"
}
if (a.second() != 0x1F.toLong()) {
return "FAIL 2"
}
if (a.third() != 0b1010.toLong()) {
return "FAIL 3"
}
if (a.fourth() != 0b1010.toLong()) {
return "FAIL 4"
}
return "OK"
}