From dafa8f72309c2137c1744238b103afb618a9eb20 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 15 Mar 2011 21:28:58 +0300 Subject: [PATCH] += can go along with + --- .../jetbrains/jet/lang/types/JetTypeInferrer.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java b/idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java index 5e139e8603e..9368a2e06c1 100644 --- a/idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java +++ b/idea/src/org/jetbrains/jet/lang/types/JetTypeInferrer.java @@ -587,18 +587,11 @@ public class JetTypeInferrer { String name = assignmentOperationNames.get(operationType); JetType assignmentOperationType = getTypeForBinaryCall(expression, name, scope, false); - String counterpartName = binaryOperationNames.get(assignmentOperationCounterparts.get(operationType)); - JetType counterpartType = getTypeForBinaryCall(expression, counterpartName, scope, false); - - if (assignmentOperationType != null) { - if (counterpartType != null) { - semanticServices.getErrorHandler().structuralError(operationSign.getNode(), "Ambiguity: both '" + name + "' and '" + counterpartName + "' are defined"); - // TODO : make reference unresolved? - trace.removeReferenceResolution(operationSign); - } else { - result = assignmentOperationType; - } + if (assignmentOperationType == null) { + String counterpartName = binaryOperationNames.get(assignmentOperationCounterparts.get(operationType)); + getTypeForBinaryCall(expression, counterpartName, scope, true); } + result = null; // TODO : not an expression } else if (equalsOperations.contains(operationType)) { String name = "equals";