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: pkg/analyzer/test/src/summary/summary_common.dart

Issue 2210293002: infer null from context, this avoids bottom being introduced (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/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 d3e94d34b9d12b3deb0c00839e69f165275d3629..2401ea865012303886fe9823a0ea1da7cfd45b88 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -8446,12 +8446,19 @@ var v = f(g: (x, y) {});
}
test_initializer_executable_with_bottom_return_type() {
- // The synthetic executable for `v` has type `() => Bottom`.
UnlinkedVariable variable = serializeVariableText('int v = null;');
expect(variable.initializer.returnType, isNull);
- checkInferredTypeSlot(
- variable.initializer.inferredReturnTypeSlot, null, null, '*bottom*',
- onlyInStrongMode: false);
+ if (strongMode) {
+ // Strong mode infers a type for the closure of `() => int`.
+ checkInferredTypeSlot(variable.initializer.inferredReturnTypeSlot,
+ 'dart:core', 'dart:core', 'int',
+ onlyInStrongMode: false);
+ } else {
+ // In Dart1 mode the synthetic executable for `v` has type `() => Bottom`.
+ checkInferredTypeSlot(
+ variable.initializer.inferredReturnTypeSlot, null, null, '*bottom*',
+ onlyInStrongMode: false);
+ }
}
test_initializer_executable_with_imported_return_type() {

Powered by Google App Engine
This is Rietveld 408576698