Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
index d1c574178b393744a2e8c87cc17a9ec138fb1434..8b65198d565bb31b2c78856ddcfd2fbc229eb4fa 100644 |
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java |
@@ -378,6 +378,7 @@ public class TypeAnalyzer implements DartCompilationPhase { |
FunctionType methodType = getMethodType(lhsType, member, methodName, diagnosticNode); |
checkDeprecated(problemTarget, element); |
Type returnType = checkInvocation(Collections.<DartExpression> singletonList(rhs), |
+ Collections.<Type> singletonList(rhsType), |
diagnosticNode, methodName, methodType, null); |
// tweak return type for int/int and int/double operators |
{ |
@@ -2794,6 +2795,11 @@ public class TypeAnalyzer implements DartCompilationPhase { |
Type argumentType = getInvocationArgumentType(argumentNode); |
argumentTypes.add(argumentType); |
} |
+ return checkInvocation(argumentNodes, argumentTypes, diagnosticNode, name, type, parameters); |
+ } |
+ |
+ private Type checkInvocation(List<DartExpression> argumentNodes, List<Type> argumentTypes, |
+ DartNode diagnosticNode, String name, Type type, List<VariableElement> parameters) { |
// Check that argument types are compatible with type of invoked object. |
try { |
switch (TypeKind.of(type)) { |