Skip to content

invalid example code on language spec 3.7 Specifying Types #1267

@vvakame

Description

@vvakame

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)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueSpecIssues related to the TypeScript language specification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions