Skip to content

got n or more with spread arguments #20372

Closed
@falsandtru

Description

@falsandtru

@sandersn Provide consistent messages?

TypeScript Version: master

Code

declare function f(): void;
f(...[]);
declare function g(): void;
declare function g(a: void): void;
g(...[]);
declare function h(a: void): void;
declare function h(a: void): void;
h(...[]);

Expected behavior:

#20097 (comment)

Actual behavior:

$ node built/local/tsc.js index.ts
index.ts(2,1): error TS2556: Expected 0 arguments, but got 1 or more.
index.ts(5,1): error TS2556: Expected 0-1 arguments, but got 0 or more.
index.ts(8,1): error TS2556: Expected 1 arguments, but got 0 or more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions