Files
kotlin-fork/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.kt.txt
T
2020-11-26 00:14:13 +03:00

59 lines
1017 B
Plaintext
Vendored

@ImplicitIntegerCoercion
const val IMPLICIT_INT: Int
field = 255
get
@ImplicitIntegerCoercion
const val EXPLICIT_INT: Int
field = 255
get
@ImplicitIntegerCoercion
const val LONG_CONST: Long
field = 255L
get
@ImplicitIntegerCoercion
val NON_CONST: Int
field = 255
get
@ImplicitIntegerCoercion
const val BIGGER_THAN_UBYTE: Int
field = 256
get
@ImplicitIntegerCoercion
const val UINT_CONST: UInt
field = 42
get
fun takeUByte(u: UByte) {
}
fun takeUShort(u: UShort) {
}
fun takeUInt(u: UInt) {
}
fun takeULong(u: ULong) {
}
fun takeUBytes(vararg u: UByte) {
}
fun takeLong(l: Long) {
}
fun test() {
takeUByte(u = <get-IMPLICIT_INT>().toUByte())
takeUByte(u = <get-EXPLICIT_INT>().toUByte())
takeUShort(u = <get-IMPLICIT_INT>().toUShort())
takeUShort(u = <get-BIGGER_THAN_UBYTE>().toUShort())
takeUInt(u = <get-IMPLICIT_INT>().toUInt())
takeULong(u = <get-IMPLICIT_INT>().toULong())
takeUBytes(u = [<get-IMPLICIT_INT>().toUByte(), <get-EXPLICIT_INT>().toUByte(), 42B])
}