Merge pull request #26150 from Kingwl/CheckReturnUnknow

add check for function return unknow type
This commit is contained in:
Ryan Cavanaugh
2018-08-06 13:52:14 -07:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -20681,7 +20681,7 @@ namespace ts {
}
// Functions with with an explicitly specified 'void' or 'any' return type don't need any return expressions.
if (returnType && maybeTypeOfKind(returnType, TypeFlags.AnyOrUnknown | TypeFlags.Void)) {
if (returnType && maybeTypeOfKind(returnType, TypeFlags.Any | TypeFlags.Void)) {
return;
}