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

Unified Diff: frog/gen.dart

Issue 9151015: addressing 3 previous review comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 11 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 | frog/member.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index 8bdddd1903e189f441e53d8b76baa9ea158f2d4e..7cace416cb0e80cfa00cb287fd080f3d1c9f4266 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -2345,7 +2345,6 @@ class MethodGenerator implements TreeVisitor {
visitListExpression(ListExpression node) {
var argValues = [];
- //var listType = node.isConst ? world.immutableListType : world.listType;
var listType = world.listType;
var type = world.varType;
if (node.itemType != null) {
@@ -2378,7 +2377,7 @@ class MethodGenerator implements TreeVisitor {
new Value.type(world.mapType, node.span), Arguments.EMPTY);
}
- var values = new List<Value>();
+ var values = <Value>[];
var valueType = world.varType, keyType = world.stringType;
var mapType = world.mapType; // TODO(jimhug): immutable type?
if (node.valueType !== null) {
@@ -2390,13 +2389,15 @@ class MethodGenerator implements TreeVisitor {
world.error('the key type of a map literal must be "String"',
keyType.span);
}
- if (node.isConst && (keyType is ParameterType || keyType.hasTypeParams)) {
+ if (node.isConst &&
+ (keyType is ParameterType || keyType.hasTypeParams)) {
world.error('type parameter cannot be used in const map literals');
}
}
valueType = method.resolveType(node.valueType, true);
- if (node.isConst && (valueType is ParameterType || valueType.hasTypeParams)) {
+ if (node.isConst &&
+ (valueType is ParameterType || valueType.hasTypeParams)) {
world.error('type parameter cannot be used in const map literals');
}
@@ -2410,7 +2411,7 @@ class MethodGenerator implements TreeVisitor {
}
values.add(key);
- var value = visitTypedValue(node.items[i+1], valueType);
+ var value = visitTypedValue(node.items[i + 1], valueType);
if (node.isConst && !value.isConst) {
world.error('const map can only contain const values', value.span);
}
« no previous file with comments | « no previous file | frog/member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698