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 f8a9177bf6be18b66157a50c187d595de2ea631a..ce1dfe702f438e83d9493bd27671865965180383 100644 |
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart |
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart |
@@ -660,8 +660,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
function is PropertyAccessorElement && |
function.isSetter; |
if (!isSetterWithImplicitReturn) { |
- _checkForReturnOfInvalidType(node.expression, expectedReturnType, |
- isArrowFunction: true); |
+ _checkForReturnOfInvalidType(node.expression, expectedReturnType); |
} |
return super.visitExpressionFunctionBody(node); |
} finally { |
@@ -5599,8 +5598,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
* See [StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]. |
*/ |
void _checkForReturnOfInvalidType( |
- Expression returnExpression, DartType expectedReturnType, |
- {bool isArrowFunction = false}) { |
+ Expression returnExpression, DartType expectedReturnType) { |
if (_enclosingFunction == null) { |
return; |
} |
@@ -5612,10 +5610,6 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
} |
DartType staticReturnType = _computeReturnTypeForMethod(returnExpression); |
if (expectedReturnType.isVoid) { |
- if (isArrowFunction) { |
- // "void f(..) => e" admits all types for "e". |
- return; |
- } |
if (staticReturnType.isVoid || |
staticReturnType.isDynamic || |
staticReturnType.isBottom || |