-
Notifications
You must be signed in to change notification settings - Fork 12.2k
/
taggedTemplatesWithTypeArguments2.types
100 lines (88 loc) · 2.42 KB
/
taggedTemplatesWithTypeArguments2.types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
=== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts ===
export interface SomethingTaggable {
<T>(t: TemplateStringsArray, ...args: T[]): SomethingNewable;
>t : TemplateStringsArray
>args : T[]
}
export interface SomethingNewable {
new <T>(...args: T[]): any;
>args : T[]
}
declare const tag: SomethingTaggable;
>tag : SomethingTaggable
const a = new tag `${100} ${200}`<string>("hello", "world");
>a : any
>new tag `${100} ${200}`<string>("hello", "world") : any
>tag `${100} ${200}` : SomethingNewable
>tag : SomethingTaggable
>`${100} ${200}` : string
>100 : 100
>200 : 200
>"hello" : "hello"
>"world" : "world"
const b = new tag<number> `${"hello"} ${"world"}`(100, 200);
>b : any
>new tag<number> `${"hello"} ${"world"}`(100, 200) : any
>tag<number> `${"hello"} ${"world"}` : any
>tag : SomethingTaggable
>`${"hello"} ${"world"}` : string
>"hello" : "hello"
>"world" : "world"
>100 : 100
>200 : 200
const c = new tag<number> `${100} ${200}`<string>("hello", "world");
>c : any
>new tag<number> `${100} ${200}`<string>("hello", "world") : any
>new tag<number> `${100} ${200}` : any
>tag<number> `${100} ${200}` : SomethingNewable
>tag : SomethingTaggable
>`${100} ${200}` : string
>100 : 100
>200 : 200
>"hello" : "hello"
>"world" : "world"
const d = new tag<number> `${"hello"} ${"world"}`<string>(100, 200);
>d : any
>new tag<number> `${"hello"} ${"world"}`<string>(100, 200) : any
>new tag<number> `${"hello"} ${"world"}` : any
>tag<number> `${"hello"} ${"world"}` : any
>tag : SomethingTaggable
>`${"hello"} ${"world"}` : string
>"hello" : "hello"
>"world" : "world"
>100 : 100
>200 : 200
/**
* Testing ASI. This should never parse as
*
* ```ts
* new tag<number>;
* `hello${369}`();
* ```
*/
const e = new tag<number>
>e : any
>new tag<number>`hello`() : any
>tag<number>`hello` : SomethingNewable
>tag : SomethingTaggable
`hello`();
>`hello` : "hello"
class SomeBase<A, B, C> {
>SomeBase : SomeBase<A, B, C>
a!: A; b!: B; c!: C;
>a : A
>b : B
>c : C
}
class SomeDerived<T> extends SomeBase<number, string, T> {
>SomeDerived : SomeDerived<T>
>SomeBase : SomeBase<number, string, T>
constructor() {
super<number, string, T> `hello world`;
>super<number, string, T> `hello world` : any
>super<number, string, T> : any
>super : SomeBase<number, string, T>
> : any
>`hello world` : "hello world"
}
}