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

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: 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 4d48866514c95619f2f715eece5cae4ee62aa3b9..2cb533aef600c36c34c780d1129c4e8c4d294ca2 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -1034,9 +1034,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,
Lasse Reichstein Nielsen 2012/09/20 12:21:08 Put the '=' on the previous line.
Johnni Winther 2012/09/21 14:00:05 Done.
+ erroneousElement.messageArguments);
compiler.reportWarning(node, warning);
- return new ErroneousElement(warning.message, name, enclosingElement);
+ return erroneousElement;
}
Element visitIdentifier(Identifier node) {
@@ -1059,6 +1067,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.
@@ -2595,7 +2605,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);
}
}

Powered by Google App Engine
This is Rietveld 408576698