Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
index fefd3ebca75ef140371cec76fc2601ee7985cce1..8699787fdab54f78fc5c6451af5e60a80bf3d27c 100644 |
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
@@ -662,8 +662,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> { |
// elements |
if (node.elements.isNotEmpty) { |
// Infer the list type from the arguments. |
- DartType staticType = |
- node.elements.map((e) => e.staticType).reduce(_leastUpperBound); |
+ Iterable<DartType> types = node.elements.map((e) => e.staticType).where((t) => t != null); |
+ if (types.isEmpty) { |
+ return null; |
+ } |
+ DartType staticType = types.reduce(_leastUpperBound); |
if (staticType.isBottom) { |
staticType = _dynamicType; |
} |