[FIR] Desugar unary plus and minus as part of integer literal

#KT-42016
This commit is contained in:
Dmitriy Novozhilov
2020-09-18 11:18:50 +03:00
parent a018847f85
commit 5efd533f55
13 changed files with 49 additions and 25 deletions
@@ -79,7 +79,7 @@ fun case_4() {
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><Int>(-2147483649)
-2147483649 checkType { <!NONE_APPLICABLE!>check<!><Byte>() }
-2147483649 checkType { <!NONE_APPLICABLE!>check<!><Short>() }
-2147483649 checkType { check<Int>() }
-2147483649 checkType { <!NONE_APPLICABLE!>check<!><Int>() }
}
// TESTCASE NUMBER: 5
@@ -96,7 +96,7 @@ fun case_5() {
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><Int>(-9223372036854775807)
-9223372036854775807 checkType { <!NONE_APPLICABLE!>check<!><Byte>() }
-9223372036854775807 checkType { <!NONE_APPLICABLE!>check<!><Short>() }
-9223372036854775807 checkType { check<Int>() }
-9223372036854775807 checkType { <!NONE_APPLICABLE!>check<!><Int>() }
}
// TESTCASE NUMBER: 6
@@ -68,7 +68,7 @@ fun case_4() {
checkSubtype<Int>(-2147483648)
checkSubtype<Long>(-2147483648)
-2147483649 checkType { <!NONE_APPLICABLE!>check<!><Long>() }
-2147483649 checkType { check<Long>() }
checkSubtype<Long>(-2147483649)
}
@@ -77,6 +77,6 @@ fun case_5() {
9223372036854775807 checkType { check<Long>() }
checkSubtype<Long>(9223372036854775807)
-9223372036854775807 checkType { <!NONE_APPLICABLE!>check<!><Long>() }
-9223372036854775807 checkType { check<Long>() }
checkSubtype<Long>(-9223372036854775807)
}
@@ -68,7 +68,7 @@ fun case_4() {
checkSubtype<Int>(-0x80000000)
checkSubtype<Long>(-0x80000000)
-0x80000001 checkType { <!NONE_APPLICABLE!>check<!><Long>() }
-0x80000001 checkType { check<Long>() }
checkSubtype<Long>(-0x80000001)
}
@@ -77,6 +77,6 @@ fun case_5() {
0X7FFFFFFFFFFFFFFF checkType { check<Long>() }
checkSubtype<Long>(0X7FFFFFFFFFFFFFFF)
-0X7FFFFFFFFFFFFFFF checkType { <!NONE_APPLICABLE!>check<!><Long>() }
-0X7FFFFFFFFFFFFFFF checkType { check<Long>() }
checkSubtype<Long>(-0X7FFFFFFFFFFFFFFF)
}
@@ -68,7 +68,7 @@ fun case_4() {
checkSubtype<Int>(-0B10000000000000000000000000000000)
checkSubtype<Long>(-0B10000000000000000000000000000000)
-0b10000000000000000000000000000001 checkType { <!NONE_APPLICABLE!>check<!><Long>() }
-0b10000000000000000000000000000001 checkType { check<Long>() }
checkSubtype<Long>(-0b10000000000000000000000000000001)
}
@@ -77,6 +77,6 @@ fun case_5() {
0b111111111111111111111111111111111111111111111111111111111111111 checkType { check<Long>() }
checkSubtype<Long>(0b111111111111111111111111111111111111111111111111111111111111111)
-0B111111111111111111111111111111111111111111111111111111111111111 checkType { <!NONE_APPLICABLE!>check<!><Long>() }
-0B111111111111111111111111111111111111111111111111111111111111111 checkType { check<Long>() }
checkSubtype<Long>(-0B111111111111111111111111111111111111111111111111111111111111111)
}