Don't allow coercing receivers from signed to unsigned constants

This commit is contained in:
Mikhail Zarechenskiy
2020-06-03 13:32:14 +03:00
parent bfa648972f
commit e72401c5f4
4 changed files with 27 additions and 1 deletions
@@ -0,0 +1,14 @@
fun UInt.fUInt() {}
fun UByte.fUByte() {}
fun UShort.fUShort() {}
fun ULong.fULong() {}
fun test() {
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fUInt<!>()
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fUByte<!>()
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fUShort<!>()
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fULong<!>()
3000000000 until <!CONSTANT_EXPECTED_TYPE_MISMATCH!>3000000004UL<!>
0 until <!CONSTANT_EXPECTED_TYPE_MISMATCH!>10u<!>
}
@@ -0,0 +1,7 @@
package
public fun test(): kotlin.Unit
public fun kotlin.UByte.fUByte(): kotlin.Unit
public fun kotlin.UInt.fUInt(): kotlin.Unit
public fun kotlin.ULong.fULong(): kotlin.Unit
public fun kotlin.UShort.fUShort(): kotlin.Unit