Correct test argument in callwithSpread2

This commit is contained in:
Nathan Shively-Sanders
2017-05-15 10:55:58 -07:00
parent 4c80aa17b3
commit cefcc668a8
3 changed files with 6 additions and 9 deletions

View File

@@ -11,12 +11,11 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(34,11): err
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(35,11): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(36,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(36,11): error TS2461: Type '(a?: number, b?: number) => void' is not an array type.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(37,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(38,1): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts (10 errors) ====
==== tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts (9 errors) ====
declare function all(a?: number, b?: number): void;
declare function weird(a?: number | string, b?: number | string): void;
declare function prefix(s: string, a?: number, b?: number): void;
@@ -70,11 +69,9 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(38,1): erro
~~~~~~~~
!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
prefix(...all) // required parameters are required
~~~~~~~~~~~~~~
prefix(...ns) // required parameters are required
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
~~~
!!! error TS2461: Type '(a?: number, b?: number) => void' is not an array type.
prefix(...mixed)
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.

View File

@@ -34,7 +34,7 @@ prefix("b", ...mixed)
prefix("c", ...tuple)
rest("e", ...mixed)
rest("f", ...tuple)
prefix(...all) // required parameters are required
prefix(...ns) // required parameters are required
prefix(...mixed)
prefix(...tuple)
@@ -61,6 +61,6 @@ prefix.apply(void 0, ["b"].concat(mixed));
prefix.apply(void 0, ["c"].concat(tuple));
rest.apply(void 0, ["e"].concat(mixed));
rest.apply(void 0, ["f"].concat(tuple));
prefix.apply(void 0, all); // required parameters are required
prefix.apply(void 0, ns); // required parameters are required
prefix.apply(void 0, mixed);
prefix.apply(void 0, tuple);

View File

@@ -33,6 +33,6 @@ prefix("b", ...mixed)
prefix("c", ...tuple)
rest("e", ...mixed)
rest("f", ...tuple)
prefix(...all) // required parameters are required
prefix(...ns) // required parameters are required
prefix(...mixed)
prefix(...tuple)