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,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)
@@ -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()
@@ -1,7 +1,6 @@
fun foo() {
val a: String
if () {
a = "aaa"
val a: String = if () {
"aaa"
}
a.charAt(1)
@@ -1,7 +1,6 @@
fun foo() {
val a: String
if () {
a = "aaa"
val a = if () {
"aaa"
}
a.charAt(1)