-
Notifications
You must be signed in to change notification settings - Fork 12.8k
undefined
return type requires explicit return
#40133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
void return type is not undefined. ok, javascript is so useless and badly thought that returning nothing and returning undefined are the same, but they are not at least not in typescript. |
I think this might be a duplicate of #36288. Given the behavior of
I think @saschanaz has a point, FWIW. |
AFAIK that's not because |
I agree that this is a duplicate, closing. |
TypeScript Version: playground
Search Terms: undefined return type
Code
Expected behavior: This should be allowed.
Actual behavior: TS requires the return type to be
void
orany
.Playground Link: https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABFApgZygCgJQC5HgAmKwMYKhiA3gFCKIQJpwA2KAdC3AOaYBEACxQBPPthoBfIA
The text was updated successfully, but these errors were encountered: