Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart |
| diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart |
| index 182b654675acfd59052ba63c887e1564608f5eb4..91ea0e06d0b7cb2cf3a87112ba03688a7dde4505 100644 |
| --- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart |
| +++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart |
| @@ -249,14 +249,6 @@ abstract class TypeInferrerImpl<S, E, V, F> extends TypeInferrer<S, E, V, F> { |
| return typeNeeded ? getterType : null; |
| } |
| - /// Performs the core type inference algorithm for string literals. |
| - /// |
| - /// [typeContext], [typeNeeded], and the return value behave as described in |
| - /// [inferExpression]. |
| - DartType inferStringLiteral(DartType typeContext, bool typeNeeded) { |
| - return typeNeeded ? coreTypes.stringClass.rawType : null; |
| - } |
| - |
| /// Performs the core type inference algorithm for string concatenations. |
| /// |
| /// [typeContext], [typeNeeded], and the return value behave as described in |
| @@ -269,6 +261,14 @@ abstract class TypeInferrerImpl<S, E, V, F> extends TypeInferrer<S, E, V, F> { |
| return typeNeeded ? coreTypes.stringClass.rawType : null; |
| } |
| + /// Performs the core type inference algorithm for string literals. |
| + /// |
| + /// [typeContext], [typeNeeded], and the return value behave as described in |
| + /// [inferExpression]. |
| + DartType inferStringLiteral(DartType typeContext, bool typeNeeded) { |
| + return typeNeeded ? coreTypes.stringClass.rawType : null; |
| + } |
| + |
| /// Performs the core type inference algorithm for variable declarations. |
| /// |
| /// [declaredType] is the declared type of the variable, or `null` if the type |
| @@ -311,6 +311,11 @@ abstract class TypeInferrerImpl<S, E, V, F> extends TypeInferrer<S, E, V, F> { |
| ? (promotedType ?? declaredType ?? const DynamicType()) |
| : null; |
| } |
| + |
| + DartType inferVariableSet(bool typeNeeded, DartType declaredType, E value) { |
| + var valueType = inferExpression(value, declaredType, typeNeeded); |
| + return typeNeeded ? valueType : null; |
|
Paul Berry
2017/05/04 19:31:03
This seems unnecessary to me. The convention is t
scheglov
2017/05/04 19:41:01
Done.
|
| + } |
| } |
| /// Keeps track of information about the innermost function or closure being |