| 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 b9508032f303e2594666ac27e9a59a7b794e72fb..3e40fb67421c0c72e1bf847ff641e1dbd5157c84 100644
|
| --- a/pkg/analyzer/lib/src/dart/element/type.dart
|
| +++ b/pkg/analyzer/lib/src/dart/element/type.dart
|
| @@ -959,6 +959,8 @@ class FunctionTypeImpl extends TypeImpl implements FunctionType {
|
| * and return TArgs.
|
| *
|
| * This function must be called with type [f] that was instantiated from [g].
|
| + *
|
| + * If [g] is not generic, returns an empty list.
|
| */
|
| static Iterable<DartType> recoverTypeArguments(
|
| FunctionType g, FunctionType f) {
|
| @@ -968,7 +970,11 @@ class FunctionTypeImpl extends TypeImpl implements FunctionType {
|
| //
|
| // For now though, this is a pretty quick operation.
|
| assert(identical(g.element, f.element));
|
| - assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty);
|
| + if (g.typeFormals.isEmpty) {
|
| + assert(g == f);
|
| + return DartType.EMPTY_LIST;
|
| + }
|
| + assert(f.typeFormals.isEmpty);
|
| assert(g.typeFormals.length + g.typeArguments.length ==
|
| f.typeArguments.length);
|
|
|
|
|