@@ -421,8 +421,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
421421 _inDoNotStoreMember = true ;
422422 }
423423 try {
424- _checkForMissingReturn (
425- node.returnType, node.functionExpression.body, element, node);
424+ _checkForMissingReturn (node.functionExpression.body, node);
426425
427426 // Return types are inferred only on non-recursive local functions.
428427 if (node.parent is CompilationUnit && ! node.isSetter) {
@@ -447,7 +446,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
447446 @override
448447 void visitFunctionExpression (FunctionExpression node) {
449448 if (node.parent is ! FunctionDeclaration ) {
450- _checkForMissingReturn (null , node.body, node.declaredElement , node);
449+ _checkForMissingReturn (node.body, node);
451450 }
452451 DartType functionType = InferenceContext .getContext (node);
453452 if (functionType is ! FunctionType ) {
@@ -557,7 +556,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
557556 try {
558557 // This was determined to not be a good hint, see: dartbug.com/16029
559558 //checkForOverridingPrivateMember(node);
560- _checkForMissingReturn (node.returnType, node. body, element , node);
559+ _checkForMissingReturn (node.body, node);
561560 _mustCallSuperVerifier.checkMethodDeclaration (node);
562561 _checkForUnnecessaryNoSuchMethod (node);
563562
@@ -1153,8 +1152,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
11531152 /// function has a return type that Future<Null> is not assignable to.
11541153 ///
11551154 /// See [HintCode.MISSING_RETURN] .
1156- void _checkForMissingReturn (TypeAnnotation returnNode, FunctionBody body,
1157- ExecutableElement element, AstNode functionNode) {
1155+ void _checkForMissingReturn (FunctionBody body, AstNode functionNode) {
11581156 if (_isNonNullableByDefault) {
11591157 return ;
11601158 }
@@ -1436,8 +1434,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
14361434 }
14371435 }
14381436
1439- /// In "strict-inference" mode, check that [returnNode] 's return type is
1440- /// specified.
1437+ /// In "strict-inference" mode, check that [returnType] is specified.
14411438 void _checkStrictInferenceReturnType (
14421439 AstNode returnType, AstNode reportNode, String displayName) {
14431440 if (! _strictInference) {
0 commit comments