Amend test data after adding Convert assignment to assignment expression intention

Relates to #KT-22420
This commit is contained in:
Vladimir Dolzhenko
2020-09-03 17:59:19 +02:00
parent 16ab11289c
commit d4ef85f6c2
12 changed files with 12 additions and 0 deletions
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test { class Test {
var bar = 1 var bar = 1
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test(var bar: Int) { class Test(var bar: Int) {
fun test(foo: Int) { fun test(foo: Int) {
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test { class Test {
var foo = "1" var foo = "1"
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test(var foo: String) { class Test(var foo: String) {
fun test(foo: Int) { fun test(foo: Int) {
+1
View File
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test(foo: Int) { class Test(foo: Int) {
fun test(foo: Int) { fun test(foo: Int) {
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test { class Test {
val foo = 1 val foo = 1
@@ -1,4 +1,5 @@
// "Assign to property" "false" // "Assign to property" "false"
// ACTION: Convert assignment to assignment expression
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
class Test(val foo: Int) { class Test(val foo: Int) {
fun test(foo: Int) { fun test(foo: Int) {
@@ -1,5 +1,6 @@
// "Change type to MutableSet" "false" // "Change type to MutableSet" "false"
// DISABLE-ERRORS // DISABLE-ERRORS
// ACTION: Convert assignment to assignment expression
// ACTION: Replace overloaded operator with function call // ACTION: Replace overloaded operator with function call
// WITH_RUNTIME // WITH_RUNTIME
fun main() { fun main() {
@@ -1,4 +1,5 @@
// "Create function 'synchronized'" "false" // "Create function 'synchronized'" "false"
// ACTION: Convert assignment to assignment expression
// ACTION: Convert expression to 'Int' // ACTION: Convert expression to 'Int'
// ACTION: Round using roundToInt() // ACTION: Round using roundToInt()
// ERROR: Type mismatch: inferred type is Float but Int was expected // ERROR: Type mismatch: inferred type is Float but Int was expected
@@ -2,6 +2,7 @@
// ACTION: Create local variable 'foo' // ACTION: Create local variable 'foo'
// ACTION: Create property 'foo' // ACTION: Create property 'foo'
// ACTION: Rename reference // ACTION: Rename reference
// ACTION: Convert assignment to assignment expression
// ERROR: Unresolved reference: foo // ERROR: Unresolved reference: foo
fun test(n: Int) { fun test(n: Int) {
@@ -1,4 +1,5 @@
// "Remove redundant assignment" "false" // "Remove redundant assignment" "false"
// ACTION: Convert assignment to assignment expression
fun foo(): Int { fun foo(): Int {
var i = 1 var i = 1
<caret>i = 2 <caret>i = 2
@@ -1,4 +1,5 @@
// "Change to var" "false" // "Change to var" "false"
// ACTION: Convert assignment to assignment expression
// ACTION: Remove redundant assignment // ACTION: Remove redundant assignment
// ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned
fun fun1(i: Int) { fun fun1(i: Int) {