| Index: pkg/analyzer/lib/src/generated/resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
|
| index 43146a226bfaa36c4155154194b0ae57d90e80b6..5f0397fd8a6424039f2cd424581c57ce9f726570 100644
|
| --- a/pkg/analyzer/lib/src/generated/resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/resolver.dart
|
| @@ -900,11 +900,19 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
|
| if (returnTypeType == null || returnTypeType.isVoid) {
|
| return;
|
| }
|
| - // For async, give no hint if Future<Null> is assignable to the return
|
| - // type.
|
| - if (body.isAsynchronous &&
|
| - _typeSystem.isAssignableTo(_futureNullType, returnTypeType)) {
|
| - return;
|
| + // For async, give no hint if the return type does not matter, i.e.
|
| + // dynamic, Future<Null> or Future<dynamic>.
|
| + if (body.isAsynchronous) {
|
| + if (returnTypeType.isDynamic) {
|
| + return;
|
| + }
|
| + if (returnTypeType is InterfaceType &&
|
| + returnTypeType.isDartAsyncFuture) {
|
| + DartType futureArgument = returnTypeType.typeArguments[0];
|
| + if (futureArgument.isDynamic || futureArgument.isDartCoreNull) {
|
| + return;
|
| + }
|
| + }
|
| }
|
| // Check the block for a return statement, if not, create the hint
|
| if (!ExitDetector.exits(body)) {
|
|
|