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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java

Issue 27179004: Issue 12103. It is warning to provide wrong number of type arguments for list/map literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Non-error tests. Created 7 years, 2 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
index 43bf9dc3acfb45738ec5b55f9d3dae71eda4553f..ab8e77ad927dfcf045be11ed3ac0591791b563e2 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
@@ -3668,13 +3668,6 @@ public class Parser {
* @return the list literal that was parsed
*/
private ListLiteral parseListLiteral(Token modifier, TypeArgumentList typeArguments) {
- // validate number of type arguments
- if (typeArguments != null) {
- int num = typeArguments.getArguments().size();
- if (num != 1) {
- reportError(ParserErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, typeArguments, num);
- }
- }
// may be empty list literal
if (matches(TokenType.INDEX)) {
BeginToken leftBracket = new BeginToken(
@@ -3790,14 +3783,6 @@ public class Parser {
* @return the map literal that was parsed
*/
private MapLiteral parseMapLiteral(Token modifier, TypeArgumentList typeArguments) {
- // validate number of type arguments
- if (typeArguments != null) {
- int num = typeArguments.getArguments().size();
- if (num != 2) {
- reportError(ParserErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, typeArguments, num);
- }
- }
- // open
Token leftBracket = expect(TokenType.OPEN_CURLY_BRACKET);
List<MapLiteralEntry> entries = new ArrayList<MapLiteralEntry>();
if (matches(TokenType.CLOSE_CURLY_BRACKET)) {

Powered by Google App Engine
This is Rietveld 408576698