mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
556 B
TypeScript
24 lines
556 B
TypeScript
//// [tests/cases/conformance/expressions/functionCalls/callOverload.ts] ////
|
|
|
|
//// [callOverload.ts]
|
|
declare function fn(x: any): void;
|
|
declare function takeTwo(x: any, y: any): void;
|
|
declare function withRest(a: any, ...args: Array<any>): void;
|
|
declare var n: number[];
|
|
|
|
fn(1) // no error
|
|
fn(1, 2, 3, 4)
|
|
takeTwo(1, 2, 3, 4)
|
|
withRest('a', ...n); // no error
|
|
withRest();
|
|
withRest(...n);
|
|
|
|
//// [callOverload.js]
|
|
"use strict";
|
|
fn(1); // no error
|
|
fn(1, 2, 3, 4);
|
|
takeTwo(1, 2, 3, 4);
|
|
withRest('a', ...n); // no error
|
|
withRest();
|
|
withRest(...n);
|