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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 11361124: Introduce AmbiguousElement (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/elements/elements.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 357c08ae25077b334580277a1f946c7bc6740d54..9342f47fa70aea1a121d9eda5288b83b1db38d7d 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1083,9 +1083,9 @@ class TypeResolver {
DartType type;
if (element == null) {
onFailure(node, MessageKind.CANNOT_RESOLVE_TYPE, [node.typeName]);
- } else if (element.isErroneous()) {
- ErroneousElement error = element;
- onFailure(node, error.messageKind, error.messageArguments);
+ } else if (element.isAmbiguous()) {
+ AmbiguousElement ambiguous = element;
+ onFailure(node, ambiguous.messageKind, ambiguous.messageArguments);
} else if (!element.impliesType()) {
onFailure(node, MessageKind.NOT_A_TYPE, [node.typeName]);
} else {
@@ -1241,17 +1241,9 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
SourceString name,
MessageKind kind,
List<Node> arguments) {
- return warnOnErroneousElement(node,
- new ErroneousElement(kind, arguments, name, enclosingElement));
- }
-
- ErroneousElement warnOnErroneousElement(Node node,
- ErroneousElement erroneousElement) {
- ResolutionWarning warning =
- new ResolutionWarning(erroneousElement.messageKind,
- erroneousElement.messageArguments);
+ ResolutionWarning warning = new ResolutionWarning(kind, arguments);
compiler.reportWarning(node, warning);
- return erroneousElement;
+ return new ErroneousElement(kind, arguments, name, enclosingElement);
}
Element visitIdentifier(Identifier node) {
@@ -1274,8 +1266,11 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
MessageKind.CANNOT_RESOLVE,
[node]);
}
- } else if (element.isErroneous()) {
- element = warnOnErroneousElement(node, element);
+ } else if (element.isAmbiguous()) {
+ AmbiguousElement ambiguous = element;
+ element = warnAndCreateErroneousElement(node, node.source,
+ ambiguous.messageKind,
+ ambiguous.messageArguments);
} else {
if ((element.kind.category & allowedCategory) == 0) {
// TODO(ahe): Improve error message. Need UX input.
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/elements/elements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698