Quick Fixes: Implement "Remove unused assignment" quickfix

#KT-9931 Fixed
This commit is contained in:
Alexey Sedunov
2016-09-02 21:07:03 +03:00
parent 074ad6b5f0
commit 0616e869aa
12 changed files with 168 additions and 0 deletions
@@ -0,0 +1,5 @@
// "Remove redundant assignment" "true"
fun test() {
var i: Int
<caret>i = 1
}
@@ -0,0 +1,4 @@
// "Remove redundant assignment" "true"
fun test() {
var i: Int
<caret>}
@@ -0,0 +1,7 @@
// "Remove redundant assignment" "true"
fun foo() = 1
fun test() {
var i: Int
<caret>i = foo()
}
@@ -0,0 +1,7 @@
// "Remove redundant assignment" "true"
fun foo() = 1
fun test() {
var i: Int
<caret>foo()
}
@@ -0,0 +1,6 @@
// "Remove redundant assignment" "false"
fun foo(): Int {
var i = 1
<caret>i = 2
return i
}
@@ -0,0 +1,5 @@
// "Remove redundant assignment" "true"
fun test(n: Int) {
var i: Int
<caret>i = n
}
@@ -0,0 +1,4 @@
// "Remove redundant assignment" "true"
fun test(n: Int) {
var i: Int
<caret>}