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

Side by Side Diff: lib/compiler/implementation/resolution/members.dart

Issue 11267039: Make unresolved access to top-level member a dynamic error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | tests/co19/co19-dart2js.status » ('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 abstract class TreeElements { 5 abstract class TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 DartType getType(Node node); 8 DartType getType(Node node);
9 bool isParameterChecked(Element element); 9 bool isParameterChecked(Element element);
10 } 10 }
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 return warnAndCreateErroneousElement(node, name, 1550 return warnAndCreateErroneousElement(node, name,
1551 MessageKind.METHOD_NOT_FOUND, 1551 MessageKind.METHOD_NOT_FOUND,
1552 [receiverClass.name, name]); 1552 [receiverClass.name, name]);
1553 } else if (target.isInstanceMember()) { 1553 } else if (target.isInstanceMember()) {
1554 error(node, MessageKind.MEMBER_NOT_STATIC, [receiverClass.name, name]); 1554 error(node, MessageKind.MEMBER_NOT_STATIC, [receiverClass.name, name]);
1555 } 1555 }
1556 } else if (identical(resolvedReceiver.kind, ElementKind.PREFIX)) { 1556 } else if (identical(resolvedReceiver.kind, ElementKind.PREFIX)) {
1557 PrefixElement prefix = resolvedReceiver; 1557 PrefixElement prefix = resolvedReceiver;
1558 target = prefix.lookupLocalMember(name); 1558 target = prefix.lookupLocalMember(name);
1559 if (target == null) { 1559 if (target == null) {
1560 error(node, MessageKind.NO_SUCH_LIBRARY_MEMBER, [prefix.name, name]); 1560 return warnAndCreateErroneousElement(
1561 node, name, MessageKind.NO_SUCH_LIBRARY_MEMBER,
1562 [prefix.name, name]);
1561 } 1563 }
1562 } 1564 }
1563 return target; 1565 return target;
1564 } 1566 }
1565 1567
1566 DartType resolveTypeTest(Node argument) { 1568 DartType resolveTypeTest(Node argument) {
1567 TypeAnnotation node = argument.asTypeAnnotation(); 1569 TypeAnnotation node = argument.asTypeAnnotation();
1568 if (node == null) { 1570 if (node == null) {
1569 // node is of the form !Type. 1571 // node is of the form !Type.
1570 node = argument.asSend().receiver.asTypeAnnotation(); 1572 node = argument.asSend().receiver.asTypeAnnotation();
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]); 2966 error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]);
2965 } else if (identical(e.kind, ElementKind.TYPE_VARIABLE)) { 2967 } else if (identical(e.kind, ElementKind.TYPE_VARIABLE)) {
2966 error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE, [name]); 2968 error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE, [name]);
2967 } else if (!identical(e.kind, ElementKind.CLASS) 2969 } else if (!identical(e.kind, ElementKind.CLASS)
2968 && !identical(e.kind, ElementKind.PREFIX)) { 2970 && !identical(e.kind, ElementKind.PREFIX)) {
2969 error(node, MessageKind.NOT_A_TYPE, [name]); 2971 error(node, MessageKind.NOT_A_TYPE, [name]);
2970 } 2972 }
2971 return e; 2973 return e;
2972 } 2974 }
2973 } 2975 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698