Source
List<ElementType> get typeArguments {
var type = _type;
if (type is FunctionType) {
Iterable<DartType> typeArguments;
if (type.element is FunctionTypeAliasElement &&
type.typeFormals.isEmpty) {
// TODO(jmesserly): simplify check above; we should have a way
// to find instantiated typedefs without consulting the element.
// Also, it will not work if we support typedefs declared inside classes.
typeArguments = type.typeArguments;
} else {
typeArguments = type.typeFormals.map((f) => f.type);
}
return typeArguments.map(_getElementTypeFrom).toList();
} else {
return (_type as ParameterizedType)
.typeArguments
.map((f) => _getElementTypeFrom(f))
.toList();
}
}