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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2905353002: Add type inference logic for map literals (Closed)
Patch Set: Created 3 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 | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index ee2cadb2cc328310d0b0d94e86f0476b8d021af0..1335994cb672fc3c2a83237fca81ddbed21bcc69 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -1355,12 +1355,12 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
debugEvent("LiteralMap");
List<MapEntry> entries = popList(count) ?? <MapEntry>[];
List<DartType> typeArguments = pop();
- DartType keyType = const DynamicType();
- DartType valueType = const DynamicType();
+ DartType keyType;
+ DartType valueType;
if (typeArguments != null) {
if (typeArguments.length != 2) {
- keyType = const DynamicType();
- valueType = const DynamicType();
+ keyType = null;
+ valueType = null;
warningNotError(
"Map literal requires two type arguments.", beginToken.charOffset);
} else {
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698