[FIR] Report ASSIGNMENT_TYPE_MISMATCH on properties with numeric types

^KT-46047
^KT-56951 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-04-28 14:47:25 +03:00
committed by Space Team
parent f7733e819d
commit 71d6103122
16 changed files with 111 additions and 76 deletions
@@ -0,0 +1,26 @@
// SKIP_TXT
// FIR_DUMP
// ------------- const -------------
val i1 = (2 + 2 * 3).inv()
val l1: Long = (2 + 2 * 3).inv()
val ll1 = (3000000000 * 2 + 1).inv()
val i2 = (2 + 2 * 3).unaryPlus()
val l2: Long = (2 + 2 * 3).unaryPlus()
val ll2 = (3000000000 * 2 + 1).unaryPlus()
val i3 = (2 + 2 * 3).unaryMinus()
val l3: Long = (2 + 2 * 3).unaryMinus()
val ll3 = (3000000000 * 2 + 1).unaryMinus()
// ------------- non const -------------
val i4 = (2 + 2 * 3).inc()
val l4: Long = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>(2 + 2 * 3).inc()<!>
val ll4 = (3000000000 * 2 + 1).inc()
val i5 = (2 + 2 * 3).dec()
val l5: Long = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>(2 + 2 * 3).dec()<!>
val ll5 = (3000000000 * 2 + 1).dec()
@@ -1,4 +1,4 @@
FILE: constantUnaryOperators.kt
FILE: constantUnaryOperators.fir.kt
public final val i1: R|kotlin/Int| = Int(2).R|kotlin/Int.plus|(Int(2).R|kotlin/Int.times|(Int(3))).R|kotlin/Int.inv|()
public get(): R|kotlin/Int|
public final val l1: R|kotlin/Long| = Int(2).R|kotlin/Int.plus|(Int(2).R|kotlin/Int.times|(Int(3))).R|kotlin/Int.inv|().R|kotlin/Int.toLong|()
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// SKIP_TXT
// FIR_DUMP