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

Unified Diff: pkg/analyzer/lib/src/dart/element/type.dart

Issue 1579303002: fix generic function expressions, part of #25175 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/type.dart
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 4e74da7b28d39e8622bb7935b7d057b90472a8e1..b804339e8561ba2cf4992c0a0eae827384db03fd 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -216,22 +216,8 @@ class FunctionTypeImpl extends TypeImpl implements FunctionType {
* Private constructor.
*/
FunctionTypeImpl._(TypeParameterizedElement element, String name,
- this.prunedTypedefs, List<DartType> typeArguments, this._isInstantiated)
- : super(element, name) {
- if (typeArguments == null) {
- // TODO(jmesserly): reuse TypeParameterTypeImpl.getTypes once we can
- // make it generic, which will allow it to return List<DartType> instead
- // of List<TypeParameterType>.
- if (typeParameters.isEmpty) {
- typeArguments = DartType.EMPTY_LIST;
- } else {
- typeArguments = new List<DartType>.from(
- typeParameters.map((t) => t.type),
- growable: false);
- }
- }
- _typeArguments = typeArguments;
- }
+ this.prunedTypedefs, this._typeArguments, this._isInstantiated)
+ : super(element, name);
/**
* Return the base parameter elements of this function element.
@@ -493,7 +479,21 @@ class FunctionTypeImpl extends TypeImpl implements FunctionType {
/**
* A list containing the actual types of the type arguments.
*/
- List<DartType> get typeArguments => _typeArguments;
+ List<DartType> get typeArguments {
+ if (_typeArguments == null) {
+ // TODO(jmesserly): reuse TypeParameterTypeImpl.getTypes once we can
+ // make it generic, which will allow it to return List<DartType> instead
+ // of List<TypeParameterType>.
+ if (typeParameters.isEmpty) {
+ _typeArguments = DartType.EMPTY_LIST;
+ } else {
+ _typeArguments = new List<DartType>.from(
+ typeParameters.map((t) => t.type),
+ growable: false);
+ }
+ }
+ return _typeArguments;
+ }
@override
List<TypeParameterElement> get typeParameters {
« 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