Surround with try/catch should generate more Kotlin-style code (KT-5435)
#KT-5435 Fixed
This commit is contained in:
Vendored
+2
-3
@@ -1,7 +1,6 @@
|
||||
fun foo() {
|
||||
val a: kotlin.test.Asserter?
|
||||
if (<caret>) {
|
||||
a = null
|
||||
val a: kotlin.test.Asserter? = if (<caret>) {
|
||||
null
|
||||
}
|
||||
|
||||
a?.charAt(1)
|
||||
|
||||
+2
-3
@@ -3,9 +3,8 @@ package test
|
||||
class A {}
|
||||
|
||||
fun foo() {
|
||||
val a: A
|
||||
if (<caret>) {
|
||||
a = test.A()
|
||||
val a = if (<caret>) {
|
||||
test.A()
|
||||
}
|
||||
|
||||
a.hashCode()
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
if () {
|
||||
a = "aaa"
|
||||
val a: String = if () {
|
||||
"aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
|
||||
Vendored
+2
-3
@@ -1,7 +1,6 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
if () {
|
||||
a = "aaa"
|
||||
val a = if () {
|
||||
"aaa"
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
|
||||
Reference in New Issue
Block a user