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

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

Issue 2877253003: Don't type promote local functions. (Closed)
Patch Set: 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 634115741fe67a1f8ab38b7153c16e1330aff7cb..81d3b539cc7fed3a547a5af7ba43370e4ad757ff 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
@@ -286,6 +286,17 @@ abstract class TypeInferrerImpl<S, E, V, F> extends TypeInferrer<S, E, V, F> {
/// [inferExpression] for the given [field]'s initializer expression.
DartType inferFieldInitializer(F field, DartType type, bool typeNeeded);
+ /// Performs the core type inference algorithm for local function
+ /// declarations.
+ ///
+ /// [body] is the body of the function.
+ void inferFunctionDeclaration(S body) {
+ var oldClosureContext = _closureContext;
+ _closureContext = null;
+ inferStatement(body);
+ _closureContext = oldClosureContext;
+ }
+
/// Performs the core type inference algorithm for function expressions.
///
/// [typeContext], [typeNeeded], and the return value behave as described in

Powered by Google App Engine
This is Rietveld 408576698