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

Side by Side Diff: dart/lib/compiler/implementation/resolver.dart

Issue 10880026: Record literal list type arguments and report errors when there are too many. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated dart2dart status Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 Type getType(TypeAnnotation annotation); 8 Type getType(TypeAnnotation annotation);
9 } 9 }
10 10
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 onFailure: report, 1553 onFailure: report,
1554 whenResolved: useType); 1554 whenResolved: useType);
1555 } 1555 }
1556 1556
1557 visitModifiers(Modifiers node) { 1557 visitModifiers(Modifiers node) {
1558 // TODO(ngeoffray): Implement this. 1558 // TODO(ngeoffray): Implement this.
1559 unimplemented(node, 'modifiers'); 1559 unimplemented(node, 'modifiers');
1560 } 1560 }
1561 1561
1562 visitLiteralList(LiteralList node) { 1562 visitLiteralList(LiteralList node) {
1563 NodeList arguments = node.typeArguments;
1564 if (arguments !== null) {
1565 Link<Node> nodes = arguments.nodes;
1566 if (nodes.isEmpty()) {
1567 error(arguments, MessageKind.MISSING_TYPE_ARGUMENT, []);
1568 } else {
1569 resolveTypeRequired(nodes.head);
1570 for (nodes = nodes.tail; !nodes.isEmpty(); nodes = nodes.tail) {
1571 error(nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT, []);
1572 resolveTypeRequired(nodes.head);
1573 }
1574 }
1575 }
1563 visit(node.elements); 1576 visit(node.elements);
1564 } 1577 }
1565 1578
1566 visitConditional(Conditional node) { 1579 visitConditional(Conditional node) {
1567 node.visitChildren(this); 1580 node.visitChildren(this);
1568 } 1581 }
1569 1582
1570 visitStringInterpolation(StringInterpolation node) { 1583 visitStringInterpolation(StringInterpolation node) {
1571 node.visitChildren(this); 1584 node.visitChildren(this);
1572 } 1585 }
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 TopScope(LibraryElement library) : super(null, library); 2579 TopScope(LibraryElement library) : super(null, library);
2567 Element lookup(SourceString name) { 2580 Element lookup(SourceString name) {
2568 return library.find(name); 2581 return library.find(name);
2569 } 2582 }
2570 2583
2571 Element add(Element newElement) { 2584 Element add(Element newElement) {
2572 throw "Cannot add an element in the top scope"; 2585 throw "Cannot add an element in the top scope";
2573 } 2586 }
2574 String toString() => '$element'; 2587 String toString() => '$element';
2575 } 2588 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698