[FE 1.0] Properly report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE

^KT-38895
This commit is contained in:
Dmitriy Novozhilov
2021-11-10 16:09:58 +03:00
committed by teamcity
parent 21444d6be8
commit 62b774b2e3
26 changed files with 126 additions and 131 deletions
@@ -8,6 +8,6 @@ annotation class Ann(
val l: Long
)
@Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass
@Ann(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 / 1<!>, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 / 1<!>, 1 / 1, 1 / 1) class MyClass
// EXPECTED: @Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort())
@@ -9,6 +9,6 @@ annotation class Ann(<!MISSING_VAL_ON_ANNOTATION_PARAMETER!>p1: Int<!>,
<!MISSING_VAL_ON_ANNOTATION_PARAMETER!>p6: Int<!>
)
@Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass
@Ann(1 or 1, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 and 1<!>, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 xor 1<!>, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass
// EXPECTED: @Ann(p1 = 1, p2 = 1.toShort(), p3 = 0.toByte(), p4 = 2, p5 = 0, p6 = 0)
@@ -11,7 +11,7 @@ annotation class Ann(
@Ann(
p1 = <!TYPE_MISMATCH!>java.lang.Byte.MAX_VALUE + 1<!>,
p2 = 1 + 1,
p2 = <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>,
p3 = java.lang.Byte.MAX_VALUE + 1,
p4 = 1.toByte() + 1.toByte(),
p5 = <!TYPE_MISMATCH!>1.toByte() + 1.toByte()<!>
@@ -8,6 +8,6 @@ annotation class Ann(
val l: Long
)
@Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1) class MyClass
@Ann(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 * 1<!>, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 * 1<!>, 1 * 1, 1 * 1) class MyClass
// EXPECTED: @Ann(b = 1.toByte(), i = 1, l = 1.toLong(), s = 1.toShort())
@@ -8,6 +8,6 @@ annotation class Ann(
val l: Long
)
@Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1) class MyClass
@Ann(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 - 1<!>, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 - 1<!>, 1 - 1, 1 - 1) class MyClass
// EXPECTED: @Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort())
@@ -8,6 +8,6 @@ annotation class Ann(
val l: Long
)
@Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1) class MyClass
@Ann(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 % 1<!>, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 % 1<!>, 1 % 1, 1 % 1) class MyClass
// EXPECTED: @Ann(b = 0.toByte(), i = 0, l = 0.toLong(), s = 0.toShort())
@@ -8,6 +8,6 @@ annotation class Ann(
val l: Long
)
@Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1) class MyClass
@Ann(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>, <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>, 1 + 1, 1 + 1) class MyClass
// EXPECTED: @Ann(b = 2.toByte(), i = 2, l = 2.toLong(), s = 2.toShort())