Fixed check for convention operator

This commit is contained in:
Valentin Kipyatkov
2016-09-30 13:26:13 +03:00
parent 57faa5a39a
commit a55273646a
4 changed files with 16 additions and 15 deletions
@@ -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)
}
}
}