Added feature to "Convert to expression body" intention: selection for easier explicit type removal

This commit is contained in:
Valentin Kipyatkov
2014-10-23 11:08:12 +04:00
parent ea69f5a9a6
commit d13fd19a63
11 changed files with 46 additions and 5 deletions
@@ -2,7 +2,7 @@ trait I {
fun foo(): String
}
fun bar(): I = object: I {
fun bar()<selection>: I</selection> = object: I {
override fun foo(): String {
return "a"
}
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun foo(): Unit = throw UnsupportedOperationException()
fun foo()<selection>: Unit</selection> = throw UnsupportedOperationException()
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun foo(): Nothing = throw UnsupportedOperationException()
fun foo()<selection>: Nothing</selection> = throw UnsupportedOperationException()
@@ -1 +1 @@
fun foo(): String = "abc"
fun foo()<selection>: String</selection> = "abc"
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun foo(): Unit = throw UnsupportedOperationException()
fun foo()<selection>: Unit</selection> = throw UnsupportedOperationException()
@@ -0,0 +1,5 @@
open class A {
protected fun <caret>foo(): String {
return "abc"
}
}
@@ -0,0 +1,3 @@
open class A {
protected fun <caret>foo(): String = "abc"
}
@@ -0,0 +1,3 @@
public fun <caret>foo(): String {
return "abc"
}
@@ -0,0 +1 @@
public fun <caret>foo(): String = "abc"