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

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

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. 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/type_resolver.dart ('k') | pkg/compiler/lib/src/serialization/modelz.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 b86593c43ca90603c3187d8b2be82bd1a6cade93..6a5d1b560e139e93315828f129fa4037c0b7ef65 100644
--- a/pkg/compiler/lib/src/resolution/typedefs.dart
+++ b/pkg/compiler/lib/src/resolution/typedefs.dart
@@ -4,9 +4,13 @@
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;
import '../diagnostics/messages.dart' show
MessageKind;
import '../elements/elements.dart' show
@@ -39,7 +43,7 @@ class TypedefResolverVisitor extends TypeDefinitionVisitor {
: super(compiler, typedefElement, registry);
visitTypedef(Typedef node) {
- element.computeType(compiler);
+ element.computeType(resolution);
scope = new TypeDeclarationScope(scope, element);
resolveTypeVariableBounds(node.typeParameters);
@@ -54,7 +58,7 @@ class TypedefResolverVisitor extends TypeDefinitionVisitor {
element.alias = signature.type;
void checkCyclicReference() {
- element.checkCyclicReference(compiler);
+ element.checkCyclicReference(resolution);
}
addDeferredAction(element, checkCyclicReference);
}
@@ -63,7 +67,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 Compiler compiler;
+ final DiagnosticListener listener;
final TypedefElementX element;
bool hasCyclicReference = false;
@@ -74,7 +78,7 @@ class TypedefCyclicVisitor extends BaseDartTypeVisitor {
Link<TypeVariableElement> seenTypeVariables =
const Link<TypeVariableElement>();
- TypedefCyclicVisitor(Compiler this.compiler, TypedefElement this.element);
+ TypedefCyclicVisitor(this.listener, this.element);
visitType(DartType type, _) {
// Do nothing.
@@ -89,13 +93,13 @@ class TypedefCyclicVisitor extends BaseDartTypeVisitor {
hasCyclicReference = true;
if (seenTypedefsCount == 1) {
// Direct cyclicity.
- compiler.reportErrorMessage(
+ listener.reportErrorMessage(
element,
MessageKind.CYCLIC_TYPEDEF,
{'typedefName': element.name});
} else if (seenTypedefsCount == 2) {
// Cyclicity through one other typedef.
- compiler.reportErrorMessage(
+ listener.reportErrorMessage(
element,
MessageKind.CYCLIC_TYPEDEF_ONE,
{'typedefName': element.name,
@@ -104,7 +108,7 @@ class TypedefCyclicVisitor extends BaseDartTypeVisitor {
// Cyclicity through more than one other typedef.
for (TypedefElement cycle in seenTypedefs) {
if (!identical(typedefElement, cycle)) {
- compiler.reportErrorMessage(
+ listener.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/serialization/modelz.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698