OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.dart.element.type; | 5 library analyzer.src.dart.element.type; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 | 2144 |
2145 /** | 2145 /** |
2146 * Returns the set of all superinterfaces of the given [type]. | 2146 * Returns the set of all superinterfaces of the given [type]. |
2147 * | 2147 * |
2148 * See [computeLeastUpperBound]. | 2148 * See [computeLeastUpperBound]. |
2149 */ | 2149 */ |
2150 static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => | 2150 static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => |
2151 _computeSuperinterfaceSet(type, new HashSet<InterfaceType>()); | 2151 _computeSuperinterfaceSet(type, new HashSet<InterfaceType>()); |
2152 | 2152 |
2153 /** | 2153 /** |
2154 * Return the type from the [types] list that has the longest inheritence path | 2154 * Return the type from the [types] list that has the longest inheritance path |
2155 * to Object of unique length. | 2155 * to Object of unique length. |
2156 */ | 2156 */ |
2157 static InterfaceType computeTypeAtMaxUniqueDepth(List<InterfaceType> types) { | 2157 static InterfaceType computeTypeAtMaxUniqueDepth(List<InterfaceType> types) { |
2158 // for each element in Set s, compute the largest inheritance path to Object | 2158 // for each element in Set s, compute the largest inheritance path to Object |
2159 List<int> depths = new List<int>.filled(types.length, 0); | 2159 List<int> depths = new List<int>.filled(types.length, 0); |
2160 int maxDepth = 0; | 2160 int maxDepth = 0; |
2161 for (int n = 0; n < types.length; n++) { | 2161 for (int n = 0; n < types.length; n++) { |
2162 depths[n] = computeLongestInheritancePathToObject(types[n]); | 2162 depths[n] = computeLongestInheritancePathToObject(types[n]); |
2163 if (depths[n] > maxDepth) { | 2163 if (depths[n] > maxDepth) { |
2164 maxDepth = depths[n]; | 2164 maxDepth = depths[n]; |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2938 | 2938 |
2939 @override | 2939 @override |
2940 TypeImpl pruned(List<FunctionTypeAliasElement> prune) => this; | 2940 TypeImpl pruned(List<FunctionTypeAliasElement> prune) => this; |
2941 | 2941 |
2942 @override | 2942 @override |
2943 VoidTypeImpl substitute2( | 2943 VoidTypeImpl substitute2( |
2944 List<DartType> argumentTypes, List<DartType> parameterTypes, | 2944 List<DartType> argumentTypes, List<DartType> parameterTypes, |
2945 [List<FunctionTypeAliasElement> prune]) => | 2945 [List<FunctionTypeAliasElement> prune]) => |
2946 this; | 2946 this; |
2947 } | 2947 } |
OLD | NEW |