| 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/ast/standard_ast_factory.dart'; | 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 * [EntityRef.implicitFunctionTypeIndices]. | 1302 * [EntityRef.implicitFunctionTypeIndices]. |
| 1303 */ | 1303 */ |
| 1304 DartType _buildType(bool instantiateToBoundsAllowed, int numTypeArguments, | 1304 DartType _buildType(bool instantiateToBoundsAllowed, int numTypeArguments, |
| 1305 DartType getTypeArgument(int i), List<int> implicitFunctionTypeIndices) { | 1305 DartType getTypeArgument(int i), List<int> implicitFunctionTypeIndices) { |
| 1306 ElementHandle element = this.element; // To allow type promotion | 1306 ElementHandle element = this.element; // To allow type promotion |
| 1307 if (element is ClassElementHandle) { | 1307 if (element is ClassElementHandle) { |
| 1308 List<DartType> typeArguments = null; | 1308 List<DartType> typeArguments = null; |
| 1309 // If type arguments are specified, use them. | 1309 // If type arguments are specified, use them. |
| 1310 // Otherwise, delay until they are requested. | 1310 // Otherwise, delay until they are requested. |
| 1311 if (numTypeParameters == 0) { | 1311 if (numTypeParameters == 0) { |
| 1312 typeArguments = const <DartType>[]; | 1312 return element.type; |
| 1313 } else if (numTypeArguments == numTypeParameters) { | 1313 } else if (numTypeArguments == numTypeParameters) { |
| 1314 typeArguments = new List<DartType>(numTypeParameters); | 1314 typeArguments = new List<DartType>(numTypeParameters); |
| 1315 for (int i = 0; i < numTypeParameters; i++) { | 1315 for (int i = 0; i < numTypeParameters; i++) { |
| 1316 typeArguments[i] = getTypeArgument(i); | 1316 typeArguments[i] = getTypeArgument(i); |
| 1317 } | 1317 } |
| 1318 } | 1318 } |
| 1319 InterfaceTypeImpl type = | 1319 InterfaceTypeImpl type = |
| 1320 new InterfaceTypeImpl.elementWithNameAndArgs(element, name, () { | 1320 new InterfaceTypeImpl.elementWithNameAndArgs(element, name, () { |
| 1321 if (typeArguments == null) { | 1321 if (typeArguments == null) { |
| 1322 typeArguments = element.typeParameters | 1322 typeArguments = element.typeParameters |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 static String _getElementIdentifier(String name, ReferenceKind kind) { | 1912 static String _getElementIdentifier(String name, ReferenceKind kind) { |
| 1913 if (kind == ReferenceKind.topLevelPropertyAccessor || | 1913 if (kind == ReferenceKind.topLevelPropertyAccessor || |
| 1914 kind == ReferenceKind.propertyAccessor) { | 1914 kind == ReferenceKind.propertyAccessor) { |
| 1915 if (!name.endsWith('=')) { | 1915 if (!name.endsWith('=')) { |
| 1916 return name + '?'; | 1916 return name + '?'; |
| 1917 } | 1917 } |
| 1918 } | 1918 } |
| 1919 return name; | 1919 return name; |
| 1920 } | 1920 } |
| 1921 } | 1921 } |
| OLD | NEW |