Files
kotlin-fork/idea/testData/refactoring/inline/addParenthesis/IfIntoArrayAccessBrackets.kt
T
Evgeny Gerashchenko 55b221776b Inline adds parentheses when it is necessary.
Test data for Remove Unnecessary Parentheses was updated, since parentheses in foo && (bar && baz) is not "unnecessary": removing it changes program semantics.

 #KT-2637 in progress
2013-07-23 21:43:04 +04:00

7 lines
124 B
Kotlin

import java.util.ArrayList
fun f() {
val a = ArrayList<Int>()
val v = if (true) 1 else 2
println(a[<caret>v])
}