| 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 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 typeArguments.add(getTypeArgument(i)); | 1692 typeArguments.add(getTypeArgument(i)); |
| 1693 } | 1693 } |
| 1694 } | 1694 } |
| 1695 ElementHandle element = this.element; // To allow type promotion | 1695 ElementHandle element = this.element; // To allow type promotion |
| 1696 if (element is ClassElementHandle) { | 1696 if (element is ClassElementHandle) { |
| 1697 return new InterfaceTypeImpl.elementWithNameAndArgs( | 1697 return new InterfaceTypeImpl.elementWithNameAndArgs( |
| 1698 element, name, typeArguments); | 1698 element, name, typeArguments); |
| 1699 } else if (element is FunctionTypeAliasElementHandle) { | 1699 } else if (element is FunctionTypeAliasElementHandle) { |
| 1700 return new FunctionTypeImpl.elementWithNameAndArgs( | 1700 return new FunctionTypeImpl.elementWithNameAndArgs( |
| 1701 element, name, typeArguments, typeArguments.isNotEmpty); | 1701 element, name, typeArguments, typeArguments.isNotEmpty); |
| 1702 } else if (element is FunctionTypedElement && | 1702 } else if (element is FunctionTypedElement) { |
| 1703 implicitFunctionTypeIndices != null) { | 1703 FunctionTypedElementComputer computer = |
| 1704 FunctionTypedElementComputer computer = () { | 1704 implicitFunctionTypeIndices != null |
| 1705 FunctionTypedElement element = this.element; | 1705 ? () { |
| 1706 for (int index in implicitFunctionTypeIndices) { | 1706 FunctionTypedElement element = this.element; |
| 1707 element = element.parameters[index].type.element; | 1707 for (int index in implicitFunctionTypeIndices) { |
| 1708 } | 1708 element = element.parameters[index].type.element; |
| 1709 return element; | 1709 } |
| 1710 }; | 1710 return element; |
| 1711 } |
| 1712 : () => this.element; |
| 1711 // TODO(paulberry): Is it a bug that we have to pass `false` for | 1713 // TODO(paulberry): Is it a bug that we have to pass `false` for |
| 1712 // isInstantiated? | 1714 // isInstantiated? |
| 1713 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); | 1715 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); |
| 1714 } else { | 1716 } else { |
| 1715 return null; | 1717 return null; |
| 1716 } | 1718 } |
| 1717 } | 1719 } |
| 1718 } | 1720 } |
| OLD | NEW |