Surround with try/catch should generate more Kotlin-style code (KT-5435)
#KT-5435 Fixed
This commit is contained in:
+2
-3
@@ -1,9 +1,8 @@
|
||||
fun foo() {
|
||||
val a: String
|
||||
val b: String
|
||||
try {
|
||||
val b = try {
|
||||
a = "aaa"
|
||||
b = "aaa"
|
||||
"aaa"
|
||||
} catch (e: <selection>Exception</selection>) {
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
<selection>val a = "aaa"</selection>
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
val a = try {
|
||||
"aaa"
|
||||
} catch (e: <selection><caret>Exception</selection>) {
|
||||
}
|
||||
|
||||
a.charAt(1)
|
||||
}
|
||||
Reference in New Issue
Block a user