Skip to content
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

invalid example code on language spec 3.7 Specifying Types #1267

Closed
vvakame opened this issue Nov 25, 2014 · 0 comments · Fixed by #1878
Closed

invalid example code on language spec 3.7 Specifying Types #1267

vvakame opened this issue Nov 25, 2014 · 0 comments · Fixed by #1878
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Spec Issues related to the TypeScript language specification

Comments

@vvakame
Copy link
Contributor

vvakame commented Nov 25, 2014

https://github.com/Microsoft/TypeScript/blob/af4a12151c7f1b0cfe6b913d7c092b825cf4f641/doc/spec.md#3.7

following code is invalid.

((x: string) => string) | (x: number) => number)

in 3.7

parentheses are required around function or constructor types in union types.

I think this example should be

((x: string) => string) | ((x: number) => number)
@danquirk danquirk added Bug A bug in TypeScript Spec Issues related to the TypeScript language specification labels Nov 25, 2014
@mhegazy mhegazy added this to the TypeScript 1.4 milestone Dec 2, 2014
@ahejlsberg ahejlsberg added the Fixed A PR has been merged for this issue label Feb 2, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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 Spec Issues related to the TypeScript language specification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants