| Index: pkg/analyzer/lib/src/summary/link.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
|
| index be4c442abfe4b01f1b4153aa7080760182ea5a6c..db465cd47830f648d60317a9b40f40dbbe142dae 100644
|
| --- a/pkg/analyzer/lib/src/summary/link.dart
|
| +++ b/pkg/analyzer/lib/src/summary/link.dart
|
| @@ -2346,7 +2346,8 @@ class ExprTypeComputer {
|
| MethodElement method = left.lookUpMethod(operator.lexeme, library);
|
| if (method != null) {
|
| DartType type = method.returnType;
|
| - type = _refineBinaryExpressionType(operator, type, left, right);
|
| + type = linker.typeSystem.refineBinaryExpressionType(
|
| + typeProvider, left, operator, right, type);
|
| stack.add(type);
|
| return;
|
| }
|
| @@ -2365,35 +2366,6 @@ class ExprTypeComputer {
|
| _pushBinaryOperatorType(propertyType, operator, operandType);
|
| }
|
|
|
| - DartType _refineBinaryExpressionType(TokenType operator, DartType currentType,
|
| - DartType leftType, DartType rightType) {
|
| - DartType intType = typeProvider.intType;
|
| - if (leftType == intType) {
|
| - // int op double
|
| - if (operator == TokenType.MINUS ||
|
| - operator == TokenType.PERCENT ||
|
| - operator == TokenType.PLUS ||
|
| - operator == TokenType.STAR) {
|
| - DartType doubleType = typeProvider.doubleType;
|
| - if (rightType == doubleType) {
|
| - return doubleType;
|
| - }
|
| - }
|
| - // int op int
|
| - if (operator == TokenType.MINUS ||
|
| - operator == TokenType.PERCENT ||
|
| - operator == TokenType.PLUS ||
|
| - operator == TokenType.STAR ||
|
| - operator == TokenType.TILDE_SLASH) {
|
| - if (rightType == intType) {
|
| - return intType;
|
| - }
|
| - }
|
| - }
|
| - // default
|
| - return currentType;
|
| - }
|
| -
|
| static TokenType _convertAssignOperatorToTokenType(
|
| UnlinkedExprAssignOperator o) {
|
| switch (o) {
|
|
|