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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 2012263002: Store expression function closures summaries when needed for type inference. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 639b2a15795a86654fe3b092b654b73d22ca8929..955d67777218263feb394df4f5b04418decb114c 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7067,6 +7067,22 @@ final v = ((a, b) => 42)(1, 2);
isValidConst: false, operators: [UnlinkedConstOperation.pushNull]);
}
+ test_expr_inClosure() {
+ if (skipNonConstInitializers) {
+ return;
+ }
+ UnlinkedVariable variable = serializeVariableText('var v = () => 1;');
+ _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr,
+ operators: [UnlinkedConstOperation.pushInt], ints: [1]);
+ }
+
+ test_expr_inClosure_noTypeInferenceNeeded() {
+ // We don't serialize closure body expressions for closures that don't need
+ // to participate in type inference.
+ UnlinkedVariable variable = serializeVariableText('Object v = () => 1;');
+ expect(variable.initializer.localFunctions[0].bodyExpr, isNull);
+ }
+
test_expr_invokeMethod_instance() {
if (skipNonConstInitializers) {
return;
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698