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.
This commit is contained in:
committed by
Nikolay Krasko
parent
85c46019d3
commit
9ce40cd17b
@@ -0,0 +1,6 @@
|
||||
class C() {
|
||||
fun get(i: Int) = i + 1
|
||||
|
||||
// KT-4513: Unnecessary parenthesis around 'this'
|
||||
val foo = (th<caret>is)[41]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class C() {
|
||||
fun get(i: Int) = i + 1
|
||||
|
||||
// KT-4513: Unnecessary parenthesis around 'this'
|
||||
val foo = this[41]
|
||||
}
|
||||
Reference in New Issue
Block a user