| 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 4a3e4fdf2307b30a436be998072b8438e4bf7ef1..7824d87777cdfdea2e5b3b5f073fe73a326ec7c9 100644
|
| --- a/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| @@ -642,7 +642,13 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| DartType expectedReturnType = functionType == null
|
| ? DynamicTypeImpl.instance
|
| : functionType.returnType;
|
| - _checkForReturnOfInvalidType(node.expression, expectedReturnType);
|
| + bool isSetterWithImplicitReturn =
|
| + _enclosingFunction.hasImplicitReturnType &&
|
| + _enclosingFunction is PropertyAccessorElement &&
|
| + (_enclosingFunction as PropertyAccessorElement).isSetter;
|
| + if (!isSetterWithImplicitReturn) {
|
| + _checkForReturnOfInvalidType(node.expression, expectedReturnType);
|
| + }
|
| return super.visitExpressionFunctionBody(node);
|
| } finally {
|
| _inAsync = wasInAsync;
|
|
|