Surround with: move declaration out from block

This commit is contained in:
Natalia.Ukhorskaya
2013-02-20 15:17:57 +04:00
parent 62266a64ee
commit 3d4a5256e6
58 changed files with 825 additions and 7 deletions
@@ -0,0 +1,9 @@
fun foo() {
<selection>"start"
open class A {}
class B: A() {}
"end"</selection>
val c = B()
val d = A()
}
@@ -0,0 +1,11 @@
fun foo() {
open class A {}
class B: A() {}
if (<caret>) {
"start"
"end"
}
val c = B()
val d = A()
}
@@ -0,0 +1,9 @@
fun foo() {
<selection>class A {
fun test() {}
}
val d: A = A()</selection>
d.test()
A()
}
@@ -0,0 +1,12 @@
fun foo() {
class A {
fun test() {}
}
val d: A
if (<caret>) {
d = A()
}
d.test()
A()
}
@@ -0,0 +1,7 @@
fun foo() {
<selection>val a: String = "aaa"
val b = a</selection>
a.charAt(1)
b.charAt(1)
}
@@ -0,0 +1,11 @@
fun foo() {
val a: String
val b: String
if (<caret>) {
a = "aaa"
b = a
}
a.charAt(1)
b.charAt(1)
}