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

Unified Diff: lib/src/info.dart

Issue 1050703002: Downwards closure inference (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Address comments Created 5 years, 9 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
« no previous file with comments | « lib/src/checker/rules.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/info.dart
diff --git a/lib/src/info.dart b/lib/src/info.dart
index c49162fba0a06731750382bdf86a8cec99bedd8d..a925bbd2939a127fae1c16dc4a4166292f412216 100644
--- a/lib/src/info.dart
+++ b/lib/src/info.dart
@@ -385,6 +385,9 @@ class InferredType extends InferredTypeBase {
if (expression is InstanceCreationExpression) {
return new InferredTypeAllocation(rules, expression, type);
}
+ if (expression is FunctionExpression) {
+ return new InferredTypeClosure(rules, expression, type);
+ }
return new InferredType(rules, expression, type);
}
}
@@ -401,6 +404,12 @@ class InferredTypeAllocation extends InferredTypeBase {
: super._internal(rules, expression, type);
}
+// An inferred type for a closure expression
+class InferredTypeClosure extends InferredTypeBase {
+ InferredTypeClosure(TypeRules rules, Expression expression, DartType type)
+ : super._internal(rules, expression, type);
+}
+
// TODO(vsm): Remove these.
// A wrapped closure coerces the underlying type to the desired type.
« no previous file with comments | « lib/src/checker/rules.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698