Skip to content

noImplicitReturns compile error for void functions as of 1.8.0-dev.20151126 #5814

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

Closed
myitcv opened this issue Nov 27, 2015 · 2 comments · Fixed by #5824
Closed

noImplicitReturns compile error for void functions as of 1.8.0-dev.20151126 #5814

myitcv opened this issue Nov 27, 2015 · 2 comments · Fixed by #5824
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@myitcv
Copy link

myitcv commented Nov 27, 2015

As of 1.8.0-dev.20151126 the following now generates a compile error when noImplicitReturns is specified in tsconfig.json:

let x = () => { console.log("Test"); }
Not all code paths return a value.

even though the type of x is () => void

This feels like a bug to me...

@DanielRosenwasser
Copy link
Member

@vladima this is what I mentioned in the PR; I don't think we should be this strict if there are no return statements at all. I'm going to mark this as a bug.

@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Nov 27, 2015
@vladima vladima added the Fixed A PR has been merged for this issue label Dec 1, 2015
@mhegazy mhegazy added this to the TypeScript 1.8 milestone Dec 1, 2015
@myitcv
Copy link
Author

myitcv commented Dec 1, 2015

👍 thanks very much! Confirmed all is good as of 1.8.0-dev.20151201

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants