| 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 86ce8301533440ca7045760c2413f134f912392b..12c9aac90526d7bcebf62e9e4836f66603e720c4 100644
|
| --- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| +++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| @@ -635,9 +635,12 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
|
| _resolver.inferenceContext.recordInference(node, contextType);
|
| } else if (node.elements.isNotEmpty) {
|
| // Infer the list type from the arguments.
|
| + // TODO(jmesserly): record inference here?
|
| staticType =
|
| node.elements.map((e) => e.staticType).reduce(_leastUpperBound);
|
| - // TODO(jmesserly): record inference here?
|
| + if (staticType.isBottom) {
|
| + staticType = _dynamicType;
|
| + }
|
| }
|
| }
|
| _recordStaticType(
|
| @@ -686,12 +689,18 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
|
| _resolver.inferenceContext.recordInference(node, contextType);
|
| } else if (node.entries.isNotEmpty) {
|
| // Infer the list type from the arguments.
|
| + // TODO(jmesserly): record inference here?
|
| staticKeyType =
|
| node.entries.map((e) => e.key.staticType).reduce(_leastUpperBound);
|
| staticValueType = node.entries
|
| .map((e) => e.value.staticType)
|
| .reduce(_leastUpperBound);
|
| - // TODO(jmesserly): record inference here?
|
| + if (staticKeyType.isBottom) {
|
| + staticKeyType = _dynamicType;
|
| + }
|
| + if (staticValueType.isBottom) {
|
| + staticValueType = _dynamicType;
|
| + }
|
| }
|
| }
|
| _recordStaticType(
|
|
|