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

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

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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/type_resolver.dart ('k') | pkg/compiler/lib/src/resolution/variables.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/typedefs.dart
diff --git a/pkg/compiler/lib/src/resolution/typedefs.dart b/pkg/compiler/lib/src/resolution/typedefs.dart
index 6a5d1b560e139e93315828f129fa4037c0b7ef65..11f57c738323bd9ea26fa51eca6a0a74da5b886c 100644
--- a/pkg/compiler/lib/src/resolution/typedefs.dart
+++ b/pkg/compiler/lib/src/resolution/typedefs.dart
@@ -4,13 +4,11 @@
library dart2js.resolution.typedefs;
-import '../common/resolution.dart' show
- Resolution;
import '../compiler.dart' show
Compiler;
import '../dart_types.dart';
import '../diagnostics/diagnostic_listener.dart' show
- DiagnosticListener;
+ DiagnosticReporter;
import '../diagnostics/messages.dart' show
MessageKind;
import '../elements/elements.dart' show
@@ -67,7 +65,7 @@ class TypedefResolverVisitor extends TypeDefinitionVisitor {
// TODO(johnniwinther): Replace with a traversal on the AST when the type
// annotations in typedef alias are stored in a [TreeElements] mapping.
class TypedefCyclicVisitor extends BaseDartTypeVisitor {
- final DiagnosticListener listener;
+ final DiagnosticReporter reporter;
final TypedefElementX element;
bool hasCyclicReference = false;
@@ -78,7 +76,7 @@ class TypedefCyclicVisitor extends BaseDartTypeVisitor {
Link<TypeVariableElement> seenTypeVariables =
const Link<TypeVariableElement>();
- TypedefCyclicVisitor(this.listener, this.element);
+ TypedefCyclicVisitor(this.reporter, TypedefElement this.element);
visitType(DartType type, _) {
// Do nothing.
@@ -93,13 +91,13 @@ class TypedefCyclicVisitor extends BaseDartTypeVisitor {
hasCyclicReference = true;
if (seenTypedefsCount == 1) {
// Direct cyclicity.
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
element,
MessageKind.CYCLIC_TYPEDEF,
{'typedefName': element.name});
} else if (seenTypedefsCount == 2) {
// Cyclicity through one other typedef.
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
element,
MessageKind.CYCLIC_TYPEDEF_ONE,
{'typedefName': element.name,
@@ -108,7 +106,7 @@ class TypedefCyclicVisitor extends BaseDartTypeVisitor {
// Cyclicity through more than one other typedef.
for (TypedefElement cycle in seenTypedefs) {
if (!identical(typedefElement, cycle)) {
- listener.reportErrorMessage(
+ reporter.reportErrorMessage(
element,
MessageKind.CYCLIC_TYPEDEF_ONE,
{'typedefName': element.name,
« no previous file with comments | « pkg/compiler/lib/src/resolution/type_resolver.dart ('k') | pkg/compiler/lib/src/resolution/variables.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698