FunctionWithLambdaExpressionBodyInspection: fix ClassCastException for "Remove braces" quick fix

#KT-32580 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-07-15 22:54:12 +09:00
committed by Dmitry Gridin
parent e5e5e9084e
commit 776cccf57c
6 changed files with 39 additions and 6 deletions
@@ -0,0 +1,6 @@
// FIX: Remove braces
class C {
fun f4() = {<caret>
"single-expression function which returns lambda"
}
}
@@ -0,0 +1,4 @@
// FIX: Remove braces
class C {
fun f4() = "single-expression function which returns lambda"
}
@@ -0,0 +1,7 @@
// FIX: Convert to run { ... }
// WITH_RUNTIME
class C {
fun f4() = {<caret>
"single-expression function which returns lambda"
}
}
@@ -0,0 +1,5 @@
// FIX: Convert to run { ... }
// WITH_RUNTIME
class C {
fun f4() = run { "single-expression function which returns lambda" }
}