KT-41298 "Remove redundant 'with' call" intention works incorrectly with non-local returns and single-expression functions (#3713)
* Remove redundant 'with' call: remove redundant 'return' keyword #KT-41298 Fixed
This commit is contained in:
committed by
GitHub
parent
8a58ada4cd
commit
a2f70dfc3d
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(): Int = <caret>with("") {
|
||||
println()
|
||||
return 42
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(): Int {
|
||||
println()
|
||||
return 42
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(s: String): Int =
|
||||
<caret>with("s") {
|
||||
return 42
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(s: String): Int =
|
||||
42
|
||||
Reference in New Issue
Block a user