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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2827463002: Issue 29360. Fix type name resolution for GenericTypeAliasElement. (Closed)
Patch Set: Created 3 years, 8 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 | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | 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) 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.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 5218 matching lines...) Expand 10 before | Expand all | Expand 10 after
5229 } 5229 }
5230 5230
5231 /** 5231 /**
5232 * Return the type of the function defined by this typedef after substituting 5232 * Return the type of the function defined by this typedef after substituting
5233 * the given [typeArguments] for the type parameters defined for this typedef 5233 * the given [typeArguments] for the type parameters defined for this typedef
5234 * (but not the type parameters defined by the function). If the number of 5234 * (but not the type parameters defined by the function). If the number of
5235 * [typeArguments] does not match the number of type parameters, then 5235 * [typeArguments] does not match the number of type parameters, then
5236 * `dynamic` will be used in place of each of the type arguments. 5236 * `dynamic` will be used in place of each of the type arguments.
5237 */ 5237 */
5238 FunctionType typeAfterSubstitution(List<DartType> typeArguments) { 5238 FunctionType typeAfterSubstitution(List<DartType> typeArguments) {
5239 GenericFunctionTypeElement function = this.function;
5240 if (function == null) {
5241 return null;
5242 }
5239 FunctionType functionType = function.type; 5243 FunctionType functionType = function.type;
5240 List<TypeParameterElement> parameterElements = typeParameters; 5244 List<TypeParameterElement> parameterElements = typeParameters;
5241 List<DartType> parameterTypes = 5245 List<DartType> parameterTypes =
5242 TypeParameterTypeImpl.getTypes(parameterElements); 5246 TypeParameterTypeImpl.getTypes(parameterElements);
5243 int parameterCount = parameterTypes.length; 5247 int parameterCount = parameterTypes.length;
5244 if (typeArguments == null || 5248 if (typeArguments == null ||
5245 parameterElements.length != typeArguments.length) { 5249 parameterElements.length != typeArguments.length) {
5246 DartType dynamicType = DynamicElementImpl.instance.type; 5250 DartType dynamicType = DynamicElementImpl.instance.type;
5247 typeArguments = new List<DartType>.filled(parameterCount, dynamicType); 5251 typeArguments = new List<DartType>.filled(parameterCount, dynamicType);
5248 } 5252 }
(...skipping 3847 matching lines...) Expand 10 before | Expand all | Expand 10 after
9096 9100
9097 @override 9101 @override
9098 void visitElement(Element element) { 9102 void visitElement(Element element) {
9099 int offset = element.nameOffset; 9103 int offset = element.nameOffset;
9100 if (offset != -1) { 9104 if (offset != -1) {
9101 map[offset] = element; 9105 map[offset] = element;
9102 } 9106 }
9103 super.visitElement(element); 9107 super.visitElement(element);
9104 } 9108 }
9105 } 9109 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698