Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1702793003: Return List<DartType> from getCurrentTypeArguments(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1774 1774
1775 /** 1775 /**
1776 * Return a list of type arguments corresponding to [currentTypeParameters], 1776 * Return a list of type arguments corresponding to [currentTypeParameters],
1777 * skipping the innermost [skipLevels] nesting levels. 1777 * skipping the innermost [skipLevels] nesting levels.
1778 * 1778 *
1779 * Type parameters are listed in nesting order from innermost to outermost, 1779 * Type parameters are listed in nesting order from innermost to outermost,
1780 * and then in declaration order. So for instance if we are resynthesizing a 1780 * and then in declaration order. So for instance if we are resynthesizing a
1781 * method declared as `class C<T, U> { void m<V, W>() { ... } }`, then the 1781 * method declared as `class C<T, U> { void m<V, W>() { ... } }`, then the
1782 * type parameters will be returned in the order `[V, W, T, U]`. 1782 * type parameters will be returned in the order `[V, W, T, U]`.
1783 */ 1783 */
1784 List<TypeParameterType> getCurrentTypeArguments({int skipLevels: 0}) { 1784 List<DartType> getCurrentTypeArguments({int skipLevels: 0}) {
1785 assert(currentTypeParameters.length >= skipLevels); 1785 assert(currentTypeParameters.length >= skipLevels);
1786 List<TypeParameterType> result = <TypeParameterType>[]; 1786 List<DartType> result = <DartType>[];
1787 for (int i = currentTypeParameters.length - 1 - skipLevels; i >= 0; i--) { 1787 for (int i = currentTypeParameters.length - 1 - skipLevels; i >= 0; i--) {
1788 result.addAll(currentTypeParameters[i] 1788 result.addAll(currentTypeParameters[i]
1789 .map((TypeParameterElement param) => param.type)); 1789 .map((TypeParameterElement param) => param.type));
1790 } 1790 }
1791 return result; 1791 return result;
1792 } 1792 }
1793 1793
1794 /** 1794 /**
1795 * Build the components of an [ElementLocationImpl] for the entity in the 1795 * Build the components of an [ElementLocationImpl] for the entity in the
1796 * given [unit] of the dependency located at [dependencyIndex], and having 1796 * given [unit] of the dependency located at [dependencyIndex], and having
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 } 2207 }
2208 : () => this.element; 2208 : () => this.element;
2209 // TODO(paulberry): Is it a bug that we have to pass `false` for 2209 // TODO(paulberry): Is it a bug that we have to pass `false` for
2210 // isInstantiated? 2210 // isInstantiated?
2211 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); 2211 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false);
2212 } else { 2212 } else {
2213 return null; 2213 return null;
2214 } 2214 }
2215 } 2215 }
2216 } 2216 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698