mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
don't check that return statement has expression in constructors
This commit is contained in:
1 parent
74e498de03
commit
e0a79bcd63
5 files changed
+37
-1
No files matched your search
@@ -13965,7 +13965,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
|
||||
else if (func.kind !== SyntaxKind.Constructor && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) {
|
||||
// The function has a return type, but the return statement doesn't have an expression.
|
||||
error(node, Diagnostics.Not_all_code_paths_return_a_value);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user