Added feature to "Convert to expression body" intention: selection for easier explicit type removal
This commit is contained in:
@@ -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
-1
@@ -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"
|
||||
Reference in New Issue
Block a user