Skip to content

Allow missing return for void any union #6512

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

Merged
merged 4 commits into from
Jan 25, 2016

Conversation

masaeedu
Copy link
Contributor

Fixes #6326

@msftclas
Copy link

Hi @masaeedu, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftclas
Copy link

@masaeedu, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

@masaeedu masaeedu force-pushed the allowMissingReturnForVoidAnyUnion branch from 07f95f3 to eb87bad Compare January 16, 2016 05:19
@@ -3885,7 +3885,7 @@ function g(x: number) {

the inferred return type for 'f' and 'g' is Any because the functions reference themselves through a cycle with no return type annotations. Adding an explicit return type 'number' to either breaks the cycle and causes the return type 'number' to be inferred for the other.

An explicitly typed function whose return type isn't the Void or the Any type must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
An explicitly typed function whose return type isn't the Void type, the Any type, or a union type containing the Void or Any type as a constituent must have at least one return statement somewhere in its body. An exception to this rule is if the function implementation consists of a single 'throw' statement.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You actually need to update the Word document (which is the authoritative source) and then run the word2md script to update this file.

Alternatively, just skip this change and log a spec bug to handle the change.

@masaeedu
Copy link
Contributor Author

@RyanCavanaugh Any other changes needed to get this merged?

@RyanCavanaugh
Copy link
Member

@mhegazy good with this?

@DanielRosenwasser
Copy link
Member

👍

@mhegazy
Copy link
Contributor

mhegazy commented Jan 25, 2016

thanks!

mhegazy added a commit that referenced this pull request Jan 25, 2016
@mhegazy mhegazy merged commit 85d09e4 into microsoft:master Jan 25, 2016
@masaeedu masaeedu deleted the allowMissingReturnForVoidAnyUnion branch January 25, 2016 23:15
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants