Convert to block body intention action

This commit is contained in:
Valentin Kipyatkov
2014-03-04 19:13:54 +04:00
parent af2a28c099
commit a2f6b99862
36 changed files with 358 additions and 17 deletions
@@ -0,0 +1,4 @@
// "Convert to block body" "true"
fun foo(): String {
return "abc"
}
@@ -0,0 +1,5 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): String {
return bar()
}
@@ -0,0 +1,6 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: XXX
// ERROR: Unresolved reference: bar
fun <caret>foo(): XXX {
return bar()
}
@@ -0,0 +1,6 @@
// "Convert to block body" "true"
fun foo(): Unit {
bar()
}
fun bar() { }
@@ -0,0 +1,5 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): Unit {
bar()
}
@@ -0,0 +1,4 @@
// "Convert to block body" "true"
fun <caret>foo(): String {
throw UnsupportedOperationException()
}
@@ -0,0 +1,5 @@
// "Convert to block body" "true"
val foo: String
get() {
return "abc"
}
@@ -0,0 +1,5 @@
// "Convert to block body" "true"
val foo: String
get() {
throw UnsupportedOperationException()
}
@@ -0,0 +1,6 @@
// "Convert to block body" "true"
import java.net.URI
fun foo(): URI {
return java.io.File("x").toURI()
}
@@ -0,0 +1,6 @@
// "Convert to block body" "true"
fun foo() {
bar()
}
fun bar() { }
@@ -0,0 +1,4 @@
// "Convert to block body" "true"
fun foo(): Nothing {
throw UnsupportedOperationException()
}
@@ -0,0 +1,8 @@
// "Convert to block body" "true"
var foo: String
get() = "abc"
set(value) {
doSet(value)
}
fun doSet(value: String){}
@@ -0,0 +1,2 @@
// "Convert to block body" "true"
fun <caret>foo(): String = "abc"
@@ -0,0 +1,3 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): String = bar()
@@ -0,0 +1,4 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: XXX
// ERROR: Unresolved reference: bar
fun <caret>foo(): XXX = bar()
@@ -0,0 +1,4 @@
// "Convert to block body" "true"
fun <caret>foo(): Unit = bar()
fun bar() { }
@@ -0,0 +1,3 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): Unit = bar()
@@ -0,0 +1,2 @@
// "Convert to block body" "true"
fun <caret>foo(): String = throw UnsupportedOperationException()
@@ -0,0 +1,3 @@
// "Convert to block body" "true"
val foo: String
<caret>get() = "abc"
@@ -0,0 +1,3 @@
// "Convert to block body" "true"
val foo: String
<caret>get() = throw UnsupportedOperationException()
@@ -0,0 +1,2 @@
// "Convert to block body" "true"
fun <caret>foo() = java.io.File("x").toURI()
@@ -0,0 +1,3 @@
// "Convert to block body" "false"
// ERROR: Unresolved reference: bar
fun <caret>foo() = bar()
@@ -0,0 +1,4 @@
// "Convert to block body" "true"
fun <caret>foo() = bar()
fun bar() { }
@@ -0,0 +1,2 @@
// "Convert to block body" "true"
fun <caret>foo(): Nothing = throw UnsupportedOperationException()
@@ -0,0 +1,6 @@
// "Convert to block body" "true"
var foo: String
get() = "abc"
<caret>set(value) = doSet(value)
fun doSet(value: String){}