translator: fix square brackets operator for binary expressions
This commit is contained in:
@@ -535,14 +535,18 @@ abstract class BlockCodegen(val state: TranslationState, val variableManager: Va
|
|||||||
return evaluateElvisOperator(expr, scopeDepth)
|
return evaluateElvisOperator(expr, scopeDepth)
|
||||||
}
|
}
|
||||||
|
|
||||||
val left = evaluateExpression(expr.firstChild, scopeDepth)
|
val left = evaluateExpression(expr.left, scopeDepth)
|
||||||
if (expr.firstChild is KtArrayAccessExpression) {
|
if (expr.left is KtArrayAccessExpression) {
|
||||||
return null
|
val callMaker = state.bindingContext.get(BindingContext.CALL, expr.left)
|
||||||
} else {
|
if (callMaker!!.callType == Call.CallType.ARRAY_SET_METHOD) {
|
||||||
left ?: throw UnsupportedOperationException("Wrong binary exception: ${expr.text}")
|
return left as LLVMVariable?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val right = evaluateExpression(expr.lastChild, scopeDepth) ?: throw UnsupportedOperationException("Wrong binary exception: ${expr.text}")
|
left ?: throw UnsupportedOperationException("Wrong binary exception: ${expr.text}")
|
||||||
|
|
||||||
|
|
||||||
|
val right = evaluateExpression(expr.right, scopeDepth) ?: throw UnsupportedOperationException("Wrong binary exception: ${expr.text}")
|
||||||
return executeBinaryExpression(operator, expr.operationReference, left, right)
|
return executeBinaryExpression(operator, expr.operationReference, left, right)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user