Files
kotlin-fork/idea/testData/intentions/removeUnnecessaryParentheses/unnecessaryParentheses8.kt
T
Tuomas Tynkkynen 9ce40cd17b Fix unnecessary parenthesis around 'this' in refactorings
Operator priority calculation for 'this' expressions was incorrect in
JetPsiUtil.getPriority(): it would return a very low value for
a JetThisExpression, causing the IDE to report that parenthesis
are necessary in an expression like '(this)[1]'.

Fix this by making JetThisExpression not implement
JetStatementExpression by removing the implements clause from
JetLabelQualifiedInstanceExpression and adding it to all other
subclasses of JetLabelQualifiedInstanceExpression.

Fixes KT-4513.
2014-02-09 17:22:27 +04:00

7 lines
129 B
Kotlin

class C() {
fun get(i: Int) = i + 1
// KT-4513: Unnecessary parenthesis around 'this'
val foo = (th<caret>is)[41]
}