Skip to content

Binding patterns in parameter lists of function types #6840

@nickie

Description

@nickie

I believe that the following two variable declarations are consistent with the specifications (3.9.2.2). They define two functions of a single parameter, which is a list of three things. Notice that a binding pattern is used for destructuring this list.

var y: ([a, b, c]) => any;
var z: ([a, b, c] : number[]) => any;

Both declarations are disallowed by the implementation. The error messages suggest that [a, b, c] is immediately assumed to be a (parenthesized) tuple type, as would be the case in:

interface a {};
interface b {};
interface c {};

var x: ([a, b, c]);

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions