Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1639)

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2855403002: Type inference for StringConcatenation. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5235cb27ce32b681afee56010fc73bd12c68e2a6..e420524717daad1de5fe02a33dccd50d361bcec2 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
@@ -243,6 +243,18 @@ 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 concatenations.
+ ///
+ /// [typeContext], [typeNeeded], and the return value behave as described in
+ /// [inferExpression].
+ DartType inferStringConcatenation(
+ DartType typeContext, bool typeNeeded, Iterable<E> expressions) {
+ for (E expression in expressions) {
+ inferExpression(expression, null, false);
+ }
+ 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

Powered by Google App Engine
This is Rietveld 408576698