Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| index b19debaebf1397226bf66d25c385cbffaef8cae7..dacfa9a5ca063294c1d6973c69db0259bd5e7019 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| @@ -997,6 +997,9 @@ class TypedefElementX extends ElementX implements TypedefElement { |
| */ |
| DartType alias; |
| + /// [:true:] if the typedef has been checked for cyclic reference. |
| + bool cyclicCheck = false; |
|
karlklose
2013/10/16 14:00:57
How about 'hasBeenCheckedForCycles'?
|
| + |
| bool get isResolved => mapping != null; |
| // TODO(johnniwinther): Store the mapping in the resolution enqueuer instead. |
| @@ -1040,6 +1043,13 @@ class TypedefElementX extends ElementX implements TypedefElement { |
| Scope buildScope() { |
| return new TypeDeclarationScope(enclosingElement.buildScope(), this); |
| } |
| + |
| + void checkCyclicReference(Compiler compiler) { |
| + if (cyclicCheck) return; |
| + var visitor = new TypedefCyclicVisitor(compiler, this); |
| + computeType(compiler).accept(visitor, null); |
| + cyclicCheck = true; |
| + } |
| } |
| class VariableElementX extends ElementX implements VariableElement { |