Fixed check for convention operator
This commit is contained in:
+9
-10
@@ -213,16 +213,15 @@ class KtSimpleNameReference(expression: KtSimpleNameExpression) : KtSimpleRefere
|
||||
val tokenType = element.operationSignTokenType
|
||||
if (tokenType != null) {
|
||||
val name = OperatorConventions.getNameForOperationSymbol(
|
||||
tokenType, element.parent is KtUnaryExpression, element.parent is KtBinaryExpression)
|
||||
if (name != null) { // can it be null ever?
|
||||
val counterpart = OperatorConventions.ASSIGNMENT_OPERATION_COUNTERPARTS[tokenType]
|
||||
if (counterpart != null) {
|
||||
val counterpartName = OperatorConventions.getNameForOperationSymbol(counterpart, false, true)!!
|
||||
return listOf(name, counterpartName)
|
||||
}
|
||||
else {
|
||||
return listOf(name)
|
||||
}
|
||||
tokenType, element.parent is KtUnaryExpression, element.parent is KtBinaryExpression
|
||||
) ?: return emptyList()
|
||||
val counterpart = OperatorConventions.ASSIGNMENT_OPERATION_COUNTERPARTS[tokenType]
|
||||
if (counterpart != null) {
|
||||
val counterpartName = OperatorConventions.getNameForOperationSymbol(counterpart, false, true)!!
|
||||
return listOf(name, counterpartName)
|
||||
}
|
||||
else {
|
||||
return listOf(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user