Surround with try/catch should generate more Kotlin-style code (KT-5435)

#KT-5435 Fixed
This commit is contained in:
shiraji
2016-10-09 12:10:45 +03:00
committed by Nikolay Krasko
parent c7c51a3d6b
commit 06dad5f45b
19 changed files with 97 additions and 57 deletions
@@ -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>) {
}
@@ -0,0 +1,5 @@
fun foo() {
<selection>val a = "aaa"</selection>
a.charAt(1)
}
@@ -0,0 +1,8 @@
fun foo() {
val a = try {
"aaa"
} catch (e: <selection><caret>Exception</selection>) {
}
a.charAt(1)
}