mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Add regression test
This commit is contained in:
parent
36be6c8b68
commit
710826e37e
@ -70,3 +70,17 @@ declare function take(cb: (a: number, b: string) => void): void;
|
||||
|
||||
(function foo(...rest){}(1, ''));
|
||||
take(function(...rest){});
|
||||
|
||||
// Repro from #29833
|
||||
|
||||
type ArgsUnion = [number, string] | [number, Error];
|
||||
type TupleUnionFunc = (...params: ArgsUnion) => number;
|
||||
|
||||
const funcUnionTupleNoRest: TupleUnionFunc = (num, strOrErr) => {
|
||||
return num;
|
||||
};
|
||||
|
||||
const funcUnionTupleRest: TupleUnionFunc = (...params) => {
|
||||
const [num, strOrErr] = params;
|
||||
return num;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user