Skip to content

Commit 23567ee

Browse files
Accepted baselines.
1 parent b409888 commit 23567ee

4 files changed

Lines changed: 465 additions & 0 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(9,18): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string'.
2+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(9,20): error TS2693: 'Stuff' only refers to a type, but is being used as a value here.
3+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(22,20): error TS2693: 'Stuff' only refers to a type, but is being used as a value here.
4+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(22,50): error TS1005: ',' expected.
5+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(39,18): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string'.
6+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(39,30): error TS2693: 'Stuff' only refers to a type, but is being used as a value here.
7+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(39,53): error TS1128: Declaration or statement expected.
8+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(40,3): error TS2339: Property 'returnedProp' does not exist on type 'boolean'.
9+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(41,3): error TS2339: Property 'returnedProp' does not exist on type 'boolean'.
10+
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts(42,3): error TS2339: Property 'returnedProp' does not exist on type 'boolean'.
11+
12+
13+
==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts (10 errors) ====
14+
declare function f<T>(strs: TemplateStringsArray, ...callbacks: Array<(x: T) => any>): void;
15+
16+
interface Stuff {
17+
x: number;
18+
y: string;
19+
z: boolean;
20+
}
21+
22+
export const a = f<Stuff> `
23+
~~~~~~~~~~
24+
~~~~~
25+
!!! error TS2693: 'Stuff' only refers to a type, but is being used as a value here.
26+
hello
27+
~~~~~~~~~
28+
${stuff => stuff.x}
29+
~~~~~~~~~~~~~~~~~~~~~~~
30+
brave
31+
~~~~~~~~~
32+
${stuff => stuff.y}
33+
~~~~~~~~~~~~~~~~~~~~~~~
34+
world
35+
~~~~~~~~~
36+
${stuff => stuff.z}
37+
~~~~~~~~~~~~~~~~~~~~~~~
38+
`;
39+
~
40+
!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string'.
41+
42+
declare function g<Input, T, U, V>(
43+
strs: TemplateStringsArray,
44+
t: (i: Input) => T, u: (i: Input) => U, v: (i: Input) => V): T | U | V;
45+
46+
export const b = g<Stuff, number, string, boolean> `
47+
~~~~~
48+
!!! error TS2693: 'Stuff' only refers to a type, but is being used as a value here.
49+
~
50+
!!! error TS1005: ',' expected.
51+
hello
52+
${stuff => stuff.x}
53+
brave
54+
${stuff => stuff.y}
55+
world
56+
${stuff => stuff.z}
57+
`;
58+
59+
declare let obj: {
60+
prop: <T>(strs: TemplateStringsArray, x: (input: T) => T) => {
61+
returnedObjProp: {
62+
lastOne: T
63+
}
64+
}
65+
}
66+
67+
export const c = obj["prop"]<Stuff> `${(input) => { ...input }}`
68+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'string'.
70+
~~~~~
71+
!!! error TS2693: 'Stuff' only refers to a type, but is being used as a value here.
72+
~~~
73+
!!! error TS1128: Declaration or statement expected.
74+
c.returnedProp.x;
75+
~~~~~~~~~~~~
76+
!!! error TS2339: Property 'returnedProp' does not exist on type 'boolean'.
77+
c.returnedProp.y;
78+
~~~~~~~~~~~~
79+
!!! error TS2339: Property 'returnedProp' does not exist on type 'boolean'.
80+
c.returnedProp.z;
81+
~~~~~~~~~~~~
82+
!!! error TS2339: Property 'returnedProp' does not exist on type 'boolean'.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//// [taggedTemplatesWithTypeArguments1.ts]
2+
declare function f<T>(strs: TemplateStringsArray, ...callbacks: Array<(x: T) => any>): void;
3+
4+
interface Stuff {
5+
x: number;
6+
y: string;
7+
z: boolean;
8+
}
9+
10+
export const a = f<Stuff> `
11+
hello
12+
${stuff => stuff.x}
13+
brave
14+
${stuff => stuff.y}
15+
world
16+
${stuff => stuff.z}
17+
`;
18+
19+
declare function g<Input, T, U, V>(
20+
strs: TemplateStringsArray,
21+
t: (i: Input) => T, u: (i: Input) => U, v: (i: Input) => V): T | U | V;
22+
23+
export const b = g<Stuff, number, string, boolean> `
24+
hello
25+
${stuff => stuff.x}
26+
brave
27+
${stuff => stuff.y}
28+
world
29+
${stuff => stuff.z}
30+
`;
31+
32+
declare let obj: {
33+
prop: <T>(strs: TemplateStringsArray, x: (input: T) => T) => {
34+
returnedObjProp: {
35+
lastOne: T
36+
}
37+
}
38+
}
39+
40+
export const c = obj["prop"]<Stuff> `${(input) => { ...input }}`
41+
c.returnedProp.x;
42+
c.returnedProp.y;
43+
c.returnedProp.z;
44+
45+
//// [taggedTemplatesWithTypeArguments1.js]
46+
export const a = f < Stuff > `
47+
hello
48+
${stuff => stuff.x}
49+
brave
50+
${stuff => stuff.y}
51+
world
52+
${stuff => stuff.z}
53+
`;
54+
export const b = g < Stuff, number, string, boolean;
55+
> `
56+
hello
57+
${stuff => stuff.x}
58+
brave
59+
${stuff => stuff.y}
60+
world
61+
${stuff => stuff.z}
62+
`;
63+
export const c = obj["prop"] < Stuff > `${(input) => { input; }}`;
64+
c.returnedProp.x;
65+
c.returnedProp.y;
66+
c.returnedProp.z;
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
=== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments1.ts ===
2+
declare function f<T>(strs: TemplateStringsArray, ...callbacks: Array<(x: T) => any>): void;
3+
>f : Symbol(f, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 0))
4+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 19))
5+
>strs : Symbol(strs, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 22))
6+
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
7+
>callbacks : Symbol(callbacks, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 49))
8+
>Array : Symbol(Array, Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more)
9+
>x : Symbol(x, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 71))
10+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 19))
11+
12+
interface Stuff {
13+
>Stuff : Symbol(Stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 92))
14+
15+
x: number;
16+
>x : Symbol(Stuff.x, Decl(taggedTemplatesWithTypeArguments1.ts, 2, 17))
17+
18+
y: string;
19+
>y : Symbol(Stuff.y, Decl(taggedTemplatesWithTypeArguments1.ts, 3, 14))
20+
21+
z: boolean;
22+
>z : Symbol(Stuff.z, Decl(taggedTemplatesWithTypeArguments1.ts, 4, 14))
23+
}
24+
25+
export const a = f<Stuff> `
26+
>a : Symbol(a, Decl(taggedTemplatesWithTypeArguments1.ts, 8, 12))
27+
>f : Symbol(f, Decl(taggedTemplatesWithTypeArguments1.ts, 0, 0))
28+
29+
hello
30+
${stuff => stuff.x}
31+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 10, 6))
32+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 10, 6))
33+
34+
brave
35+
${stuff => stuff.y}
36+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 12, 6))
37+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 12, 6))
38+
39+
world
40+
${stuff => stuff.z}
41+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 14, 6))
42+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 14, 6))
43+
44+
`;
45+
46+
declare function g<Input, T, U, V>(
47+
>g : Symbol(g, Decl(taggedTemplatesWithTypeArguments1.ts, 15, 2))
48+
>Input : Symbol(Input, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 19))
49+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 25))
50+
>U : Symbol(U, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 28))
51+
>V : Symbol(V, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 31))
52+
53+
strs: TemplateStringsArray,
54+
>strs : Symbol(strs, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 35))
55+
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
56+
57+
t: (i: Input) => T, u: (i: Input) => U, v: (i: Input) => V): T | U | V;
58+
>t : Symbol(t, Decl(taggedTemplatesWithTypeArguments1.ts, 18, 31))
59+
>i : Symbol(i, Decl(taggedTemplatesWithTypeArguments1.ts, 19, 8))
60+
>Input : Symbol(Input, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 19))
61+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 25))
62+
>u : Symbol(u, Decl(taggedTemplatesWithTypeArguments1.ts, 19, 23))
63+
>i : Symbol(i, Decl(taggedTemplatesWithTypeArguments1.ts, 19, 28))
64+
>Input : Symbol(Input, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 19))
65+
>U : Symbol(U, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 28))
66+
>v : Symbol(v, Decl(taggedTemplatesWithTypeArguments1.ts, 19, 43))
67+
>i : Symbol(i, Decl(taggedTemplatesWithTypeArguments1.ts, 19, 48))
68+
>Input : Symbol(Input, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 19))
69+
>V : Symbol(V, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 31))
70+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 25))
71+
>U : Symbol(U, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 28))
72+
>V : Symbol(V, Decl(taggedTemplatesWithTypeArguments1.ts, 17, 31))
73+
74+
export const b = g<Stuff, number, string, boolean> `
75+
>b : Symbol(b, Decl(taggedTemplatesWithTypeArguments1.ts, 21, 12))
76+
>g : Symbol(g, Decl(taggedTemplatesWithTypeArguments1.ts, 15, 2))
77+
>number : Symbol(number, Decl(taggedTemplatesWithTypeArguments1.ts, 21, 25))
78+
>string : Symbol(string, Decl(taggedTemplatesWithTypeArguments1.ts, 21, 33))
79+
>boolean : Symbol(boolean, Decl(taggedTemplatesWithTypeArguments1.ts, 21, 41))
80+
81+
hello
82+
${stuff => stuff.x}
83+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 23, 6))
84+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 23, 6))
85+
86+
brave
87+
${stuff => stuff.y}
88+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 25, 6))
89+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 25, 6))
90+
91+
world
92+
${stuff => stuff.z}
93+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 27, 6))
94+
>stuff : Symbol(stuff, Decl(taggedTemplatesWithTypeArguments1.ts, 27, 6))
95+
96+
`;
97+
98+
declare let obj: {
99+
>obj : Symbol(obj, Decl(taggedTemplatesWithTypeArguments1.ts, 30, 11))
100+
101+
prop: <T>(strs: TemplateStringsArray, x: (input: T) => T) => {
102+
>prop : Symbol(prop, Decl(taggedTemplatesWithTypeArguments1.ts, 30, 18))
103+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 11))
104+
>strs : Symbol(strs, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 14))
105+
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
106+
>x : Symbol(x, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 41))
107+
>input : Symbol(input, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 46))
108+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 11))
109+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 11))
110+
111+
returnedObjProp: {
112+
>returnedObjProp : Symbol(returnedObjProp, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 66))
113+
114+
lastOne: T
115+
>lastOne : Symbol(lastOne, Decl(taggedTemplatesWithTypeArguments1.ts, 32, 26))
116+
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments1.ts, 31, 11))
117+
}
118+
}
119+
}
120+
121+
export const c = obj["prop"]<Stuff> `${(input) => { ...input }}`
122+
>c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 38, 12))
123+
>obj : Symbol(obj, Decl(taggedTemplatesWithTypeArguments1.ts, 30, 11))
124+
>"prop" : Symbol(prop, Decl(taggedTemplatesWithTypeArguments1.ts, 30, 18))
125+
>input : Symbol(input, Decl(taggedTemplatesWithTypeArguments1.ts, 38, 40))
126+
>input : Symbol(input, Decl(taggedTemplatesWithTypeArguments1.ts, 38, 40))
127+
128+
c.returnedProp.x;
129+
>c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 38, 12))
130+
131+
c.returnedProp.y;
132+
>c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 38, 12))
133+
134+
c.returnedProp.z;
135+
>c : Symbol(c, Decl(taggedTemplatesWithTypeArguments1.ts, 38, 12))
136+

0 commit comments

Comments
 (0)