Skip to content

Commit 2f36455

Browse files
author
Maria Solano
committed
Keeping the other check just to be safe
1 parent f497490 commit 2f36455

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35687,7 +35687,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3568735687
error(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);
3568835688
}
3568935689
}
35690-
else if (type && strictNullChecks) {
35690+
else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) {
3569135691
error(errorNode, Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
3569235692
}
3569335693
else if (compilerOptions.noImplicitReturns) {

0 commit comments

Comments
 (0)