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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10968010: Import scope rules updated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 3 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: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 5621de3cab7def3badf720bda5d5e40860bcc2f6..3de67b305322f456a1d5ef3c13fef8c238b0f5ca 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -904,6 +904,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.impliesType()) {
onFailure(node, MessageKind.NOT_A_TYPE, [node.typeName]);
} else {
@@ -1051,9 +1054,17 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
SourceString name,
MessageKind kind,
List<Node> arguments) {
- ResolutionWarning warning = new ResolutionWarning(kind, arguments);
+ return warnOnErroneousElement(node,
+ new ErroneousElement(kind, arguments, name, enclosingElement));
+ }
+
+ ErroneousElement warnOnErroneousElement(Node node,
+ ErroneousElement erroneousElement) {
+ ResolutionWarning warning =
+ new ResolutionWarning(erroneousElement.messageKind,
+ erroneousElement.messageArguments);
compiler.reportWarning(node, warning);
- return new ErroneousElement(warning.message, name, enclosingElement);
+ return erroneousElement;
}
Element visitIdentifier(Identifier node) {
@@ -1076,6 +1087,8 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
MessageKind.CANNOT_RESOLVE,
[node]);
}
+ } else if (element.isErroneous()) {
+ element = warnOnErroneousElement(node, element);
} else {
if ((element.kind.category & allowedCategory) == 0) {
// TODO(ahe): Improve error message. Need UX input.
@@ -2624,7 +2637,7 @@ class ConstructorResolver extends CommonResolverVisitor<Element> {
} else {
ResolutionWarning warning = new ResolutionWarning(kind, arguments);
compiler.reportWarning(diagnosticNode, warning);
- return new ErroneousFunctionElement(warning.message, targetName,
+ return new ErroneousFunctionElement(kind, arguments, targetName,
enclosing);
}
}
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698