| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library summary_resynthesizer; | 5 library summary_resynthesizer; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1687 typeArguments.add(getTypeArgument(i)); | 1687 typeArguments.add(getTypeArgument(i)); |
| 1688 } | 1688 } |
| 1689 } | 1689 } |
| 1690 ElementHandle element = this.element; // To allow type promotion | 1690 ElementHandle element = this.element; // To allow type promotion |
| 1691 if (element is ClassElementHandle) { | 1691 if (element is ClassElementHandle) { |
| 1692 return new InterfaceTypeImpl.elementWithNameAndArgs( | 1692 return new InterfaceTypeImpl.elementWithNameAndArgs( |
| 1693 element, name, typeArguments); | 1693 element, name, typeArguments); |
| 1694 } else if (element is FunctionTypeAliasElementHandle) { | 1694 } else if (element is FunctionTypeAliasElementHandle) { |
| 1695 return new FunctionTypeImpl.elementWithNameAndArgs( | 1695 return new FunctionTypeImpl.elementWithNameAndArgs( |
| 1696 element, name, typeArguments, typeArguments.isNotEmpty); | 1696 element, name, typeArguments, typeArguments.isNotEmpty); |
| 1697 } else if (element is FunctionTypedElement && | 1697 } else if (element is FunctionTypedElement) { |
| 1698 implicitFunctionTypeIndices != null) { | 1698 FunctionTypedElementComputer computer = |
| 1699 FunctionTypedElementComputer computer = () { | 1699 implicitFunctionTypeIndices != null |
| 1700 FunctionTypedElement element = this.element; | 1700 ? () { |
| 1701 for (int index in implicitFunctionTypeIndices) { | 1701 FunctionTypedElement element = this.element; |
| 1702 element = element.parameters[index].type.element; | 1702 for (int index in implicitFunctionTypeIndices) { |
| 1703 } | 1703 element = element.parameters[index].type.element; |
| 1704 return element; | 1704 } |
| 1705 }; | 1705 return element; |
| 1706 } |
| 1707 : () => this.element; |
| 1706 // TODO(paulberry): Is it a bug that we have to pass `false` for | 1708 // TODO(paulberry): Is it a bug that we have to pass `false` for |
| 1707 // isInstantiated? | 1709 // isInstantiated? |
| 1708 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); | 1710 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); |
| 1709 } else { | 1711 } else { |
| 1710 return null; | 1712 return null; |
| 1711 } | 1713 } |
| 1712 } | 1714 } |
| 1713 } | 1715 } |
| OLD | NEW |