* Scribbles + tests The second test actually requires node types * Basically working The two simple fixes, in arity error reporting, are in, and the simplification of arity error reporting is half-done. I haven't started on any improvements to call assignability. * trim out too-real test case * Finish cleanup And reword error a little. * Simplify and reword spread errors * handle spreads first * update baselines * Address PR comments
128 lines
4.7 KiB
Plaintext
128 lines
4.7 KiB
Plaintext
=== tests/cases/conformance/expressions/functionCalls/callWithSpread3.ts ===
|
|
declare const s2: [string, string];
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
declare const s3: [string, string, string];
|
|
>s3 : Symbol(s3, Decl(callWithSpread3.ts, 1, 13))
|
|
|
|
declare const s2_: [string, string, ...string[]];
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
|
|
declare const s_: string[];
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
|
|
declare const n_: number[];
|
|
>n_ : Symbol(n_, Decl(callWithSpread3.ts, 4, 13))
|
|
|
|
declare const s2n_: [string, string, ...number[]];
|
|
>s2n_ : Symbol(s2n_, Decl(callWithSpread3.ts, 5, 13))
|
|
|
|
declare function fs2(a: string, b: string): void;
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>a : Symbol(a, Decl(callWithSpread3.ts, 7, 21))
|
|
>b : Symbol(b, Decl(callWithSpread3.ts, 7, 31))
|
|
|
|
declare function fs2_(a: string, b: string, ...c: string[]): void;
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>a : Symbol(a, Decl(callWithSpread3.ts, 8, 22))
|
|
>b : Symbol(b, Decl(callWithSpread3.ts, 8, 32))
|
|
>c : Symbol(c, Decl(callWithSpread3.ts, 8, 43))
|
|
|
|
declare function fs2n_(a: string, b: string, ...c: number[]): void;
|
|
>fs2n_ : Symbol(fs2n_, Decl(callWithSpread3.ts, 8, 66))
|
|
>a : Symbol(a, Decl(callWithSpread3.ts, 9, 23))
|
|
>b : Symbol(b, Decl(callWithSpread3.ts, 9, 33))
|
|
>c : Symbol(c, Decl(callWithSpread3.ts, 9, 44))
|
|
|
|
declare function fs5(a: string, b: string, c: string, d: string, e: string): void;
|
|
>fs5 : Symbol(fs5, Decl(callWithSpread3.ts, 9, 67))
|
|
>a : Symbol(a, Decl(callWithSpread3.ts, 10, 21))
|
|
>b : Symbol(b, Decl(callWithSpread3.ts, 10, 31))
|
|
>c : Symbol(c, Decl(callWithSpread3.ts, 10, 42))
|
|
>d : Symbol(d, Decl(callWithSpread3.ts, 10, 53))
|
|
>e : Symbol(e, Decl(callWithSpread3.ts, 10, 64))
|
|
|
|
// error
|
|
fs2('a', ...s2); // error on ...s2
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
fs2('a', 'b', 'c', ...s2); // error on 'c' and ...s2
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
fs2('a', 'b', ...s2, 'c'); // error on ...s2 and 'c'
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
fs2('a', 'b', 'c', ...s2, 'd'); // error on 'c', ...s2 and 'd'
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
fs2(...s2, 'a'); // error on 'a'
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
fs2(...s3); // error on ...s3
|
|
>fs2 : Symbol(fs2, Decl(callWithSpread3.ts, 5, 50))
|
|
>s3 : Symbol(s3, Decl(callWithSpread3.ts, 1, 13))
|
|
|
|
fs2_(...s_); // error on ...s_
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
|
|
fs2_(...s2n_); // error on ...s2n_
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s2n_ : Symbol(s2n_, Decl(callWithSpread3.ts, 5, 13))
|
|
|
|
fs2_(...s_, ...s_); // error on ...s_
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
|
|
fs2_(...s_, ...s_, ...s_); // error on ...s_
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
|
|
// fs2n_(...s2, ...s_); // FIXME: should be a type error
|
|
fs2n_(...s2_); // error on ...s2_
|
|
>fs2n_ : Symbol(fs2n_, Decl(callWithSpread3.ts, 8, 66))
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
|
|
// ok
|
|
fs2_(...s2_);
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
|
|
fs2_(...s2_, ...s_);
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
|
|
fs2_(...s2_, ...s2_);
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
|
|
fs2_(...s_, ...s2_);
|
|
>fs2_ : Symbol(fs2_, Decl(callWithSpread3.ts, 7, 49))
|
|
>s_ : Symbol(s_, Decl(callWithSpread3.ts, 3, 13))
|
|
>s2_ : Symbol(s2_, Decl(callWithSpread3.ts, 2, 13))
|
|
|
|
fs2n_(...s2n_);
|
|
>fs2n_ : Symbol(fs2n_, Decl(callWithSpread3.ts, 8, 66))
|
|
>s2n_ : Symbol(s2n_, Decl(callWithSpread3.ts, 5, 13))
|
|
|
|
fs2n_(...s2);
|
|
>fs2n_ : Symbol(fs2n_, Decl(callWithSpread3.ts, 8, 66))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|
|
// fs2n_(...s2, ...n_); // FIXME: should compile
|
|
fs5(...s2, "foo", ...s2);
|
|
>fs5 : Symbol(fs5, Decl(callWithSpread3.ts, 9, 67))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
>s2 : Symbol(s2, Decl(callWithSpread3.ts, 0, 13))
|
|
|