| Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| index 5cf1c87b7260dfa160c34e90d9a04f0b0c179c47..99a51ce11e396ed8769f890b92003b4000a95eaa 100644
|
| --- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| +++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| @@ -1391,13 +1391,19 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
|
| DartType
|
| _computeStaticReturnTypeOfFunctionExpression(FunctionExpression node) {
|
| FunctionBody body = node.body;
|
| + if (body.isGenerator) {
|
| + if (body.isAsynchronous) {
|
| + return _typeProvider.streamDynamicType;
|
| + } else {
|
| + return _typeProvider.iterableDynamicType;
|
| + }
|
| + }
|
| DartType type;
|
| if (body is ExpressionFunctionBody) {
|
| type = _getStaticType(body.expression);
|
| } else {
|
| type = _dynamicType;
|
| }
|
| - // TODO(paulberry): also handle generator functions.
|
| if (body.isAsynchronous) {
|
| return _typeProvider.futureType.substitute4(<DartType>[type]);
|
| } else {
|
|
|