don't check that return statement has expression in constructors

This commit is contained in:
Vladimir Matveev
2016-03-13 15:31:55 -07:00
parent 74e498de03
commit e0a79bcd63
5 changed files with 37 additions and 1 deletions

View File

@@ -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);
}