Chromium Code Reviews| Index: pkg/analyzer/lib/src/generated/resolver.dart |
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart |
| index 95a19cbd2758dab9dd0e7dd590142072d38f5350..05d73a83f0aec60fa093f54fbe169d3d25dd5950 100644 |
| --- a/pkg/analyzer/lib/src/generated/resolver.dart |
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart |
| @@ -14918,33 +14918,16 @@ class TypeResolverVisitor extends ScopedVisitor { |
| void _setFunctionTypedParameterType(ParameterElementImpl element, |
| TypeName returnType, FormalParameterList parameterList) { |
| List<ParameterElement> parameters = _getElements(parameterList); |
| - FunctionTypeAliasElementImpl aliasElement = |
| - new FunctionTypeAliasElementImpl.forNode(null); |
| - aliasElement.synthetic = true; |
| - aliasElement.shareParameters(parameters); |
| - aliasElement.returnType = _computeReturnType(returnType); |
| + FunctionElementImpl functionElement = new FunctionElementImpl.forNode(null); |
| + functionElement.synthetic = true; |
| + functionElement.shareParameters(parameters); |
| + functionElement.returnType = _computeReturnType(returnType); |
| // FunctionTypeAliasElementImpl assumes the enclosing element is a |
|
Brian Wilkerson
2015/11/14 17:05:09
This comment is obsolete and should be removed.
Jennifer Messerly
2015/11/16 21:51:07
Done.
|
| // CompilationUnitElement (because non-synthetic function types can only be |
| // declared at top level), so to avoid breaking things, go find the |
| // compilation unit element. |
| - aliasElement.enclosingElement = |
| - element.getAncestor((element) => element is CompilationUnitElement); |
| - ClassElement definingClass = |
| - element.getAncestor((element) => element is ClassElement); |
| - if (definingClass != null) { |
| - aliasElement.shareTypeParameters(definingClass.typeParameters); |
| - } else { |
| - FunctionTypeAliasElement alias = |
| - element.getAncestor((element) => element is FunctionTypeAliasElement); |
| - while (alias != null && alias.isSynthetic) { |
| - alias = |
| - alias.getAncestor((element) => element is FunctionTypeAliasElement); |
| - } |
| - if (alias != null) { |
| - aliasElement.typeParameters = alias.typeParameters; |
| - } |
| - } |
| - element.type = new FunctionTypeImpl.forTypedef(aliasElement); |
| + functionElement.enclosingElement = element; |
| + element.type = new FunctionTypeImpl(functionElement); |
| } |
| /** |