Index: pkg/analyzer/lib/src/generated/error_verifier.dart |
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart |
index 1b99f57aaca59e32d6d22f80900cde5fe13cba4e..befeccf958640ff7291ed70d062ba857e77308f3 100644 |
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart |
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart |
@@ -2281,9 +2281,22 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
} |
// RETURN_WITHOUT_VALUE |
if (returnExpression == null) { |
- if (_inGenerator || |
- _typeSystem.isAssignableTo( |
- _computeReturnTypeForMethod(null), expectedReturnType)) { |
+ if (_inGenerator) { |
+ return; |
+ } else if (_inAsync) { |
+ if (expectedReturnType.isDynamic) { |
+ return; |
+ } |
+ if (expectedReturnType is InterfaceType && |
+ expectedReturnType.isDartAsyncFuture) { |
+ DartType futureArgument = expectedReturnType.typeArguments[0]; |
+ if (futureArgument.isDynamic || |
+ futureArgument.isDartCoreNull || |
+ futureArgument.isObject) { |
+ return; |
+ } |
+ } |
+ } else if (expectedReturnType.isDynamic || expectedReturnType.isVoid) { |
return; |
} |
_hasReturnWithoutValue = true; |
@@ -5476,7 +5489,8 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
if (expectedReturnType.isVoid) { |
if (staticReturnType.isVoid || |
staticReturnType.isDynamic || |
- staticReturnType.isBottom) { |
+ staticReturnType.isBottom || |
+ staticReturnType.isDartCoreNull) { |
return; |
} |
_errorReporter.reportTypeErrorForNode( |
@@ -6427,7 +6441,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
} |
bool _isFunctionType(DartType type) { |
- if (type.isDynamic || type.isBottom) { |
+ if (type.isDynamic || type.isDartCoreNull) { |
return true; |
} else if (type is FunctionType || type.isDartCoreFunction) { |
return true; |