function checkLastSegment(node) {
			if (!funcInfo.shouldCheck) {
				return;
			}

			const messageAndSuggestions = { messageId: "", suggest: [] };

			if (funcInfo.arrayMethodName === "forEach") {
				if (
					options.checkForEach &&
					node.type === "ArrowFunctionExpression" &&
					node.expression
				) {
					if (options.allowVoid) {
						if (isExpressionVoid(node.body)) {
							return;
						}

						messageAndSuggestions.messageId =
							"expectedNoReturnValue";
						messageAndSuggestions.suggest = [
							{
								messageId: "wrapBraces",
								fix(fixer) {
									return curlyWrapFixer(
										sourceCode,
										node,
										fixer,
									);
								},
							},
							{
								messageId: "prependVoid",
								fix(fixer) {
									return voidPrependFixer(
										sourceCode,
										node.body,
										fixer,
									);
								},
							},
						];
					} else {
						messageAndSuggestions.messageId =
							"expectedNoReturnValue";
						messageAndSuggestions.suggest = [
							{
								messageId: "wrapBraces",
								fix(fixer) {
									return curlyWrapFixer(
										sourceCode,
										node,
										fixer,
									);
								},
							},
						];
					}
				}
			} else {
				if (
					node.body.type === "BlockStatement" &&
					isAnySegmentReachable(funcInfo.currentSegments)
				) {
					messageAndSuggestions.messageId = funcInfo.hasReturn
						? "expectedAtEnd"
						: "expectedInside";
				}
			}

			if (messageAndSuggestions.messageId) {
				const name = astUtils.getFunctionNameWithKind(node);

				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					messageId: messageAndSuggestions.messageId,
					data: {
						name,
						arrayMethodName: fullMethodName(
							funcInfo.arrayMethodName,
						),
					},
					suggest:
						messageAndSuggestions.suggest.length !== 0
							? messageAndSuggestions.suggest
							: null,
				});
			}
		}
Checks whether or not the last code path segment is reachable.
Then reports this function if the segment is reachable.

If the last code path segment is reachable, there are paths which are not
returned or thrown.
@param {ASTNode} node A node to check.
@returns {void}