• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//// [aliasOfGenericFunctionWithRestBehavedSameAsUnaliased.ts]
2// the type printback for every `test` below should be "y"
3
4type ExtendedMapper<HandledInputT, OutputT, ArgsT extends any[]> = (name : string, mixed : HandledInputT, ...args : ArgsT) => OutputT;
5type a = ExtendedMapper<any, any, [any]>;
6type b = ExtendedMapper<any, any, any[]>;
7type test = a extends b ? "y" : "n"
8let check: test = "y";
9
10
11type ExtendedMapper1<HandledInputT, OutputT, ArgsT extends any[]> = (
12    (name : string, mixed : HandledInputT, ...args : ArgsT) => OutputT
13);
14
15type a1 = ExtendedMapper1<any, any, [any]>;
16type b1 = ExtendedMapper1<any, any, any[]>;
17type test1 = a1 extends b1 ? "y" : "n"
18let check1: test1 = "y";
19
20type ExtendedMapper2<HandledInputT, OutputT, ArgsT extends any[]> = (
21    {x:(name : string, mixed : HandledInputT, ...args : ArgsT) => OutputT}["x"]
22);
23
24type a2 = ExtendedMapper2<any, any, [any]>;
25type b2 = ExtendedMapper2<any, any, any[]>;
26type test2 = a2 extends b2 ? "y" : "n"
27let check2: test2 = "y";
28
29type a3 = (name: string, mixed: any, args_0: any) => any
30type b3 = (name: string, mixed: any, ...args: any[]) => any
31
32type test3 = a3 extends b3 ? "y" : "n"
33let check3: test3 = "y";
34
35
36//// [aliasOfGenericFunctionWithRestBehavedSameAsUnaliased.js]
37"use strict";
38// the type printback for every `test` below should be "y"
39var check = "y";
40var check1 = "y";
41var check2 = "y";
42var check3 = "y";
43