| Index: pkg/compiler/lib/src/closure.dart
|
| diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
|
| index 175ca25b47159c2eae98fc7ab29d5e3ce236362f..4aaa293a517a487019f9f1d0da5edbc01a2695fe 100644
|
| --- a/pkg/compiler/lib/src/closure.dart
|
| +++ b/pkg/compiler/lib/src/closure.dart
|
| @@ -93,7 +93,7 @@ abstract class CapturedVariable {}
|
| // TODO(ahe): These classes continuously cause problems. We need to
|
| // find a more general solution.
|
| class ClosureFieldElement extends ElementX
|
| - implements VariableElement, CapturedVariable {
|
| + implements FieldElement, CapturedVariable {
|
| /// The [BoxLocal] or [LocalElement] being accessed through the field.
|
| final Local local;
|
|
|
| @@ -146,6 +146,9 @@ class ClosureFieldElement extends ElementX
|
| accept(ElementVisitor visitor) => visitor.visitClosureFieldElement(this);
|
|
|
| Element get analyzableElement => closureClass.methodElement.analyzableElement;
|
| +
|
| + @override
|
| + List<FunctionElement> get nestedClosures => const <FunctionElement>[];
|
| }
|
|
|
| // TODO(ahe): These classes continuously cause problems. We need to find
|
| @@ -226,7 +229,7 @@ class BoxLocal extends Local {
|
| // TODO(ngeoffray, ahe): These classes continuously cause problems. We need to
|
| // find a more general solution.
|
| class BoxFieldElement extends ElementX
|
| - implements TypedElement, CapturedVariable {
|
| + implements TypedElement, CapturedVariable, FieldElement {
|
| final BoxLocal box;
|
|
|
| BoxFieldElement(String name, this.variableElement, BoxLocal box)
|
| @@ -240,6 +243,33 @@ class BoxFieldElement extends ElementX
|
| final VariableElement variableElement;
|
|
|
| accept(ElementVisitor visitor) => visitor.visitBoxFieldElement(this);
|
| +
|
| + @override
|
| + bool get hasNode => false;
|
| +
|
| + @override
|
| + bool get hasResolvedAst => false;
|
| +
|
| + @override
|
| + Expression get initializer {
|
| + throw new UnsupportedError("BoxFieldElement.initializer");
|
| + }
|
| +
|
| + @override
|
| + MemberElement get memberContext => box.executableContext.memberContext;
|
| +
|
| + @override
|
| + List<FunctionElement> get nestedClosures => const <FunctionElement>[];
|
| +
|
| + @override
|
| + Node get node {
|
| + throw new UnsupportedError("BoxFieldElement.node");
|
| + }
|
| +
|
| + @override
|
| + ResolvedAst get resolvedAst {
|
| + throw new UnsupportedError("BoxFieldElement.resolvedAst");
|
| + }
|
| }
|
|
|
| /// A local variable used encode the direct (uncaptured) references to [this].
|
| @@ -254,7 +284,8 @@ class ThisLocal extends Local {
|
| }
|
|
|
| /// Call method of a closure class.
|
| -class SynthesizedCallMethodElementX extends BaseFunctionElementX {
|
| +class SynthesizedCallMethodElementX extends BaseFunctionElementX
|
| + implements MethodElement {
|
| final LocalFunctionElement expression;
|
|
|
| SynthesizedCallMethodElementX(String name,
|
|
|