| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionTypeScope.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionTypeScope.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionTypeScope.java
|
| index 41a350c530e881e137155b93b1ab92e2a9e6cd75..a7e5a36d3d3cbd550b4dd5e2fa073abc0b5e805e 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionTypeScope.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/scope/FunctionTypeScope.java
|
| @@ -24,6 +24,9 @@ import com.google.dart.engine.element.TypeParameterElement;
|
| * @coverage dart.engine.resolver
|
| */
|
| public class FunctionTypeScope extends EnclosedScope {
|
| + private final FunctionTypeAliasElement typeElement;
|
| + private boolean parametersDefined;
|
| +
|
| /**
|
| * Initialize a newly created scope enclosed within another scope.
|
| *
|
| @@ -32,8 +35,8 @@ public class FunctionTypeScope extends EnclosedScope {
|
| */
|
| public FunctionTypeScope(Scope enclosingScope, FunctionTypeAliasElement typeElement) {
|
| super(new EnclosedScope(enclosingScope));
|
| - defineTypeParameters(typeElement);
|
| - defineParameters(typeElement);
|
| + this.typeElement = typeElement;
|
| + defineTypeParameters();
|
| }
|
|
|
| /**
|
| @@ -41,7 +44,11 @@ public class FunctionTypeScope extends EnclosedScope {
|
| *
|
| * @param typeElement the element representing the type represented by this scope
|
| */
|
| - private void defineParameters(FunctionTypeAliasElement typeElement) {
|
| + public void defineParameters() {
|
| + if (parametersDefined) {
|
| + return;
|
| + }
|
| + parametersDefined = true;
|
| for (ParameterElement parameter : typeElement.getParameters()) {
|
| define(parameter);
|
| }
|
| @@ -52,7 +59,7 @@ public class FunctionTypeScope extends EnclosedScope {
|
| *
|
| * @param typeElement the element representing the type represented by this scope
|
| */
|
| - private void defineTypeParameters(FunctionTypeAliasElement typeElement) {
|
| + private void defineTypeParameters() {
|
| Scope typeParameterScope = getEnclosingScope();
|
| for (TypeParameterElement typeParameter : typeElement.getTypeParameters()) {
|
| typeParameterScope.define(typeParameter);
|
|
|