function checkLastSegment(node) {
			let loc, name;

			/*
			 * Skip if it expected no return value or unreachable.
			 * When unreachable, all paths are returned or thrown.
			 */
			if (
				!funcInfo.hasReturnValue ||
				areAllSegmentsUnreachable(funcInfo.currentSegments) ||
				astUtils.isES5Constructor(node) ||
				isClassConstructor(node)
			) {
				return;
			}

			// Adjust a location and a message.
			if (node.type === "Program") {
				// The head of program.
				loc = { line: 1, column: 0 };
				name = "program";
			} else if (node.type === "ArrowFunctionExpression") {
				// `=>` token
				loc = context.sourceCode.getTokenBefore(
					node.body,
					astUtils.isArrowToken,
				).loc;
			} else if (
				node.parent.type === "MethodDefinition" ||
				(node.parent.type === "Property" && node.parent.method)
			) {
				// Method name.
				loc = node.parent.key.loc;
			} else {
				// Function name or `function` keyword.
				loc = (node.id || context.sourceCode.getFirstToken(node)).loc;
			}

			if (!name) {
				name = astUtils.getFunctionNameWithKind(node);
			}

			// Reports.
			context.report({
				node,
				loc,
				messageId: "missingReturn",
				data: { name },
			});
		}
Checks whether of not the implicit returning is consistent if the last
code path segment is reachable.
@param {ASTNode} node A program/function node to check.
@returns {void}