Chromium Code Reviews| Index: lib/compiler/implementation/scanner/listener.dart |
| diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart |
| index 2c6bd2377d52c277fe55a599310486bb91568a22..69edb8da0e3504e9ffbfc0cd0bbfafd31eb2341f 100644 |
| --- a/lib/compiler/implementation/scanner/listener.dart |
| +++ b/lib/compiler/implementation/scanner/listener.dart |
| @@ -1268,8 +1268,15 @@ class NodeListener extends ElementListener { |
| Token endToken) { |
| NodeList elements = makeNodeList(count, beginToken, endToken, ','); |
| NodeList typeArguments = popNode(); |
| - // TODO(ahe): Type arguments are discarded. |
| - pushNode(new LiteralList(null, elements, constKeyword)); |
| + TypeAnnotation type = null; |
| + if (typeArguments !== null) { |
| + if (typeArguments.length() != 1) { |
|
ahe
2012/08/23 13:06:35
The method [length] is O(n). The method [length] s
|
| + error('Type annotations for list literal should have a single type', |
|
ahe
2012/08/23 13:06:35
If this error should be reported here, it should b
|
| + constKeyword.next); |
|
ahe
2012/08/23 13:06:35
This error position is wrong. First, there may be
|
| + } |
| + type = typeArguments.iterator().next(); |
|
ahe
2012/08/23 13:06:35
Calling iterator always creates a new object. This
|
| + } |
|
ahe
2012/08/23 13:06:35
Unfortunately, you discarded the NodeList and now
|
| + pushNode(new LiteralList(type, elements, constKeyword)); |
| } |
| void handleIndexedExpression(Token openSquareBracket, |