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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 1880803002: Fix AST-based type inference on empty lists. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 87d02abedcd47ab7e5ffb7f8b7c6b812888fc293..1b3f15fa5287835fb07461b801505ccd823d5cdb 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -2048,7 +2048,9 @@ class ExprTypeComputer {
void _doMakeUntypedList() {
int numItems = _getNextInt();
- DartType itemType = _popList(numItems).reduce(_leastUpperBound);
+ DartType itemType = numItems == 0
+ ? DynamicTypeImpl.instance
+ : _popList(numItems).reduce(_leastUpperBound);
itemType = _dynamicIfNull(itemType);
stack.add(typeProvider.listType.instantiate(<DartType>[itemType]));
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698