Update spread tests w/new excess arguments error

This commit is contained in:
Nathan Shively-Sanders
2017-11-16 09:39:31 -08:00
parent 8657dc10a7
commit 865f3281bc
5 changed files with 22 additions and 74 deletions

View File

@@ -1,21 +1,23 @@
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(30,5): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(22,1): error TS2556: Expected 1 arguments, but got a minimum of 2.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(23,1): error TS2556: Expected 0 arguments, but got a minimum of 1.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(26,5): 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(31,5): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(27,5): 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(32,13): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(28,13): 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(33,13): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(29,13): 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(34,11): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(30,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(35,11): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(31,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 TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(37,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(38,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(32,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(33,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(34,1): error TS2556: Expected 1-3 arguments, but got a minimum of 0.
==== tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts (9 errors) ====
==== tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts (11 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;
@@ -36,13 +38,13 @@ tests/cases/conformance/expressions/functionCalls/callWithSpread2.ts(38,1): erro
rest("d", ...ns)
// this covers the arguments case
// extra arguments
normal("g", ...ns)
normal("h", ...mixed)
normal("i", ...tuple)
~~~~~~~~~~~~~~~~~~
!!! error TS2556: Expected 1 arguments, but got a minimum of 2.
thunk(...ns)
thunk(...mixed)
thunk(...tuple)
~~~~~~~~~~~~
!!! error TS2556: Expected 0 arguments, but got a minimum of 1.
// bad
all(...mixed)

View File

@@ -19,13 +19,9 @@ prefix("a", ...ns)
rest("d", ...ns)
// this covers the arguments case
// extra arguments
normal("g", ...ns)
normal("h", ...mixed)
normal("i", ...tuple)
thunk(...ns)
thunk(...mixed)
thunk(...tuple)
// bad
all(...mixed)
@@ -47,13 +43,9 @@ weird.apply(void 0, mixed);
weird.apply(void 0, tuple);
prefix.apply(void 0, ["a"].concat(ns));
rest.apply(void 0, ["d"].concat(ns));
// this covers the arguments case
// extra arguments
normal.apply(void 0, ["g"].concat(ns));
normal.apply(void 0, ["h"].concat(mixed));
normal.apply(void 0, ["i"].concat(tuple));
thunk.apply(void 0, ns);
thunk.apply(void 0, mixed);
thunk.apply(void 0, tuple);
// bad
all.apply(void 0, mixed);
all.apply(void 0, tuple);

View File

@@ -64,31 +64,15 @@ rest("d", ...ns)
>ns : Symbol(ns, Decl(callWithSpread2.ts, 7, 11))
// this covers the arguments case
// extra arguments
normal("g", ...ns)
>normal : Symbol(normal, Decl(callWithSpread2.ts, 3, 83))
>ns : Symbol(ns, Decl(callWithSpread2.ts, 7, 11))
normal("h", ...mixed)
>normal : Symbol(normal, Decl(callWithSpread2.ts, 3, 83))
>mixed : Symbol(mixed, Decl(callWithSpread2.ts, 8, 11))
normal("i", ...tuple)
>normal : Symbol(normal, Decl(callWithSpread2.ts, 3, 83))
>tuple : Symbol(tuple, Decl(callWithSpread2.ts, 9, 11))
thunk(...ns)
>thunk : Symbol(thunk, Decl(callWithSpread2.ts, 4, 41))
>ns : Symbol(ns, Decl(callWithSpread2.ts, 7, 11))
thunk(...mixed)
>thunk : Symbol(thunk, Decl(callWithSpread2.ts, 4, 41))
>mixed : Symbol(mixed, Decl(callWithSpread2.ts, 8, 11))
thunk(...tuple)
>thunk : Symbol(thunk, Decl(callWithSpread2.ts, 4, 41))
>tuple : Symbol(tuple, Decl(callWithSpread2.ts, 9, 11))
// bad
all(...mixed)
>all : Symbol(all, Decl(callWithSpread2.ts, 0, 0))

View File

@@ -78,7 +78,7 @@ rest("d", ...ns)
>ns : number[]
// this covers the arguments case
// extra arguments
normal("g", ...ns)
>normal("g", ...ns) : void
>normal : (s: string) => void
@@ -86,38 +86,12 @@ normal("g", ...ns)
>...ns : number
>ns : number[]
normal("h", ...mixed)
>normal("h", ...mixed) : void
>normal : (s: string) => void
>"h" : "h"
>...mixed : string | number
>mixed : (string | number)[]
normal("i", ...tuple)
>normal("i", ...tuple) : void
>normal : (s: string) => void
>"i" : "i"
>...tuple : string | number
>tuple : [number, string]
thunk(...ns)
>thunk(...ns) : string
>thunk : () => string
>...ns : number
>ns : number[]
thunk(...mixed)
>thunk(...mixed) : string
>thunk : () => string
>...mixed : string | number
>mixed : (string | number)[]
thunk(...tuple)
>thunk(...tuple) : string
>thunk : () => string
>...tuple : string | number
>tuple : [number, string]
// bad
all(...mixed)
>all(...mixed) : void

View File

@@ -18,13 +18,9 @@ prefix("a", ...ns)
rest("d", ...ns)
// this covers the arguments case
// extra arguments
normal("g", ...ns)
normal("h", ...mixed)
normal("i", ...tuple)
thunk(...ns)
thunk(...mixed)
thunk(...tuple)
// bad
all(...mixed)