Introduce Variable: Do not insert unused variable references

#KT-7227 Fixed
This commit is contained in:
Alexey Sedunov
2015-06-16 17:49:42 +03:00
parent 1506531e59
commit 683a8895df
8 changed files with 76 additions and 14 deletions
@@ -1,6 +1,5 @@
fun a() {
val i = 1
i
i
if (true) i
}
@@ -0,0 +1,10 @@
class A {
fun test() = 1
}
fun main(args: Array<String>) {
val a = A()
<selection>a.test()</selection>
val b = a.test()
}
@@ -0,0 +1,10 @@
class A {
fun test() = 1
}
fun main(args: Array<String>) {
val a = A()
val i = a.test()
val b = i
}
@@ -0,0 +1,10 @@
class A {
fun test() = 1
}
fun main(args: Array<String>) {
val a = A()
a.test()
val b = <selection>a.test()</selection>
}
@@ -0,0 +1,10 @@
class A {
fun test() = 1
}
fun main(args: Array<String>) {
val a = A()
val i = a.test()
val b = i
}