Introduce "Assign to property" quick-fix #KT-17204 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
67a50e92d0
commit
e92af08c98
@@ -0,0 +1,9 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test {
|
||||
var bar = 1
|
||||
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test(var bar: Int) {
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test {
|
||||
var foo = "1"
|
||||
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test(var foo: String) {
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Assign to property" "true"
|
||||
class Test {
|
||||
val foo: Int
|
||||
|
||||
constructor(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Assign to property" "true"
|
||||
class Test {
|
||||
val foo: Int
|
||||
|
||||
constructor(foo: Int) {
|
||||
this.foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test(foo: Int) {
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Assign to property" "true"
|
||||
// WITH_RUNTIME
|
||||
class Test {
|
||||
var foo = 1
|
||||
|
||||
fun test(foo: Int) {
|
||||
"".run {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Assign to property" "true"
|
||||
// WITH_RUNTIME
|
||||
class Test {
|
||||
var foo = 1
|
||||
|
||||
fun test(foo: Int) {
|
||||
"".run {
|
||||
this@Test.foo = foo
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Assign to property" "true"
|
||||
class Test {
|
||||
var foo = 1
|
||||
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Assign to property" "true"
|
||||
class Test {
|
||||
var foo = 1
|
||||
|
||||
fun test(foo: Int) {
|
||||
this.foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Assign to property" "true"
|
||||
class Test {
|
||||
var foo = 1
|
||||
|
||||
fun test(foo: String) {
|
||||
<caret>foo = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Assign to property" "true"
|
||||
class Test {
|
||||
var foo = 1
|
||||
|
||||
fun test(foo: String) {
|
||||
this.foo = 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Assign to property" "true"
|
||||
class Test(var foo: Int) {
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Assign to property" "true"
|
||||
class Test(var foo: Int) {
|
||||
fun test(foo: Int) {
|
||||
this.foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test {
|
||||
val foo = 1
|
||||
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Assign to property" "false"
|
||||
// ERROR: Val cannot be reassigned
|
||||
class Test(val foo: Int) {
|
||||
fun test(foo: Int) {
|
||||
<caret>foo = foo
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user