[FIR] Add lValueTypeRef to FirVariableAssignment, fix tests with ASSIGNMENT_TYPE_MISMATCH
This commit is contained in:
committed by
TeamCityServer
parent
e57108d4e8
commit
c3b8f3e859
Vendored
+12
-12
@@ -22,10 +22,10 @@ class WrongIncDec() {
|
||||
|
||||
fun testWrongIncDec() {
|
||||
var x = WrongIncDec()
|
||||
<error descr="[RESULT_TYPE_MISMATCH] WrongIncDec, kotlin/Int">x++</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] WrongIncDec, kotlin/Int">++x</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] WrongIncDec, kotlin/Int">x--</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] WrongIncDec, kotlin/Int">--x</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Int but WrongIncDec was expected">x++</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Int but WrongIncDec was expected">++x</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Int but WrongIncDec was expected">x--</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Int but WrongIncDec was expected">--x</error>
|
||||
}
|
||||
|
||||
class UnitIncDec() {
|
||||
@@ -35,12 +35,12 @@ class UnitIncDec() {
|
||||
|
||||
fun testUnitIncDec() {
|
||||
var x = UnitIncDec()
|
||||
<error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">x++</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">++x</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">x--</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">--x</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">x++</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">x--</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">++x</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] UnitIncDec, kotlin/Unit">--x</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">x++</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">++x</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">x--</error>
|
||||
<error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">--x</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">x++</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">x--</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">++x</error>
|
||||
x = <error descr="[RESULT_TYPE_MISMATCH] Function return type mismatch: actual type is kotlin/Unit but UnitIncDec was expected">--x</error>
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
get() : Int = 1
|
||||
set(value : <error descr="[WRONG_SETTER_PARAMETER_TYPE] Setter parameter type must be equal to the type of the property, i.e. 'kotlin/Int'">Long</error>) {
|
||||
field = value.toInt()
|
||||
field = 1.toLong()
|
||||
field = <error descr="[ASSIGNMENT_TYPE_MISMATCH] Assignment type mismatch: actual type is kotlin/Long but kotlin/Int was expected">1.toLong()</error>
|
||||
}
|
||||
|
||||
val xx : Int = <error descr="[PROPERTY_INITIALIZER_NO_BACKING_FIELD] Initializer is not allowed here because this property has no backing field">1 + x</error>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ class A() {
|
||||
var x: Int = 0
|
||||
get() = "s"
|
||||
set(value: <error descr="[WRONG_SETTER_PARAMETER_TYPE] Setter parameter type must be equal to the type of the property, i.e. 'kotlin/Int'">String</error>) {
|
||||
field = value
|
||||
field = <error descr="[ASSIGNMENT_TYPE_MISMATCH] Assignment type mismatch: actual type is kotlin/String but kotlin/Int was expected">value</error>
|
||||
}
|
||||
val y: Int
|
||||
get(): <error descr="[WRONG_GETTER_RETURN_TYPE] Getter return type must be equal to the type of the property, i.e. 'kotlin/Int'">String</error> = "s"
|
||||
|
||||
Reference in New Issue
Block a user