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

Unified Diff: pkg/compiler/lib/src/resolution/resolution_common.dart

Issue 1363993004: Report info messages together with their error, warning, or hint. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/resolution_common.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution_common.dart b/pkg/compiler/lib/src/resolution/resolution_common.dart
index 67974330fcc28a1527e749345202ae0f364aeda5..eb7b80b8b0e4fb80a3e37fc3934ac37c95723218 100644
--- a/pkg/compiler/lib/src/resolution/resolution_common.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_common.dart
@@ -8,6 +8,8 @@ import '../common/tasks.dart' show
DeferredAction;
import '../compiler.dart' show
Compiler;
+import '../diagnostics/diagnostic_listener.dart' show
+ DiagnosticMessage;
import '../diagnostics/messages.dart' show
MessageKind;
import '../diagnostics/spannable.dart' show
@@ -28,9 +30,8 @@ class CommonResolverVisitor<R> extends Visitor<R> {
CommonResolverVisitor(Compiler this.compiler);
R visitNode(Node node) {
- internalError(node,
+ return compiler.internalError(node,
'internal error: Unhandled node: ${node.getObjectDescription()}');
- return null;
}
R visitEmptyStatement(Node node) => null;
@@ -38,18 +39,6 @@ class CommonResolverVisitor<R> extends Visitor<R> {
/** Convenience method for visiting nodes that may be null. */
R visit(Node node) => (node == null) ? null : node.accept(this);
- void error(Spannable node, MessageKind kind, [Map arguments = const {}]) {
- compiler.reportError(node, kind, arguments);
- }
-
- void warning(Spannable node, MessageKind kind, [Map arguments = const {}]) {
- compiler.reportWarning(node, kind, arguments);
- }
-
- internalError(Spannable node, message) {
- compiler.internalError(node, message);
- }
-
void addDeferredAction(Element element, DeferredAction action) {
compiler.enqueuer.resolution.addDeferredAction(element, action);
}
@@ -86,7 +75,7 @@ abstract class MappingVisitor<T> extends CommonResolverVisitor<T> {
if (element.name == 'yield' ||
element.name == 'async' ||
element.name == 'await') {
- compiler.reportError(
+ compiler.reportErrorMessage(
node, MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER,
{'keyword': element.name,
'modifier': currentAsyncMarker});
@@ -106,9 +95,16 @@ abstract class MappingVisitor<T> extends CommonResolverVisitor<T> {
void reportDuplicateDefinition(String name,
Spannable definition,
Spannable existing) {
- compiler.reportError(definition,
- MessageKind.DUPLICATE_DEFINITION, {'name': name});
- compiler.reportInfo(existing,
- MessageKind.EXISTING_DEFINITION, {'name': name});
+ compiler.reportError(
+ compiler.createMessage(
+ definition,
+ MessageKind.DUPLICATE_DEFINITION,
+ {'name': name}),
+ <DiagnosticMessage>[
+ compiler.createMessage(
+ existing,
+ MessageKind.EXISTING_DEFINITION,
+ {'name': name}),
+ ]);
}
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698