You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instantiableTupleLabels1.ts(4,27): error TS5087: A labeled tuple element is declared as rest with a '...' before the name, rather than before the type.
2
+
instantiableTupleLabels1.ts(15,24): error TS2322: Type 'unknown' is not assignable to type 'string | number | bigint | boolean | null | undefined'.
3
+
instantiableTupleLabels1.ts(18,46): error TS2322: Type 'T1' is not assignable to type 'string | number | bigint | boolean | null | undefined'.
4
+
instantiableTupleLabels1.ts(18,71): error TS2322: Type 'T2' is not assignable to type 'string | number | bigint | boolean | null | undefined'.
5
+
6
+
7
+
==== instantiableTupleLabels1.ts (4 errors) ====
8
+
type T1 = [`wow`: boolean];
9
+
type T2 = [number, `wow`: boolean];
10
+
type T3 = [number, ...`wow`: boolean[]];
11
+
type T4 = [number, `wow`: ...boolean[]]; // error
12
+
~~~~~~~~~~~~
13
+
!!! error TS5087: A labeled tuple element is declared as rest with a '...' before the name, rather than before the type.
14
+
15
+
type Prefix = 'pre';
16
+
17
+
type T5 = [`${Prefix}wow`: boolean];
18
+
type T6 = [number, `${Prefix}wow`: boolean];
19
+
type T7 = [number, ...`${Prefix}wow`: boolean[]];
20
+
21
+
type T8 = [number, `${never}wontfly`: boolean]; // no label displayed
22
+
type T9 = [number, `${any}wontfly`: boolean]; // no label displayed
23
+
type T11 = [number, `${"a" | "b"}wontfly`: boolean]; // no label displayed
24
+
type T12 = [number, `${unknown}wontfly`: boolean]; // error
25
+
~~~~~~~
26
+
!!! error TS2322: Type 'unknown' is not assignable to type 'string | number | bigint | boolean | null | undefined'.
!!! error TS2322: Type 'T1' is not assignable to type 'string | number | bigint | boolean | null | undefined'.
32
+
!!! related TS2208 instantiableTupleLabels1.ts:18:17: This type parameter might need an `extends string | number | bigint | boolean | null | undefined` constraint.
33
+
~~
34
+
!!! error TS2322: Type 'T2' is not assignable to type 'string | number | bigint | boolean | null | undefined'.
35
+
!!! related TS2208 instantiableTupleLabels1.ts:18:21: This type parameter might need an `extends string | number | bigint | boolean | null | undefined` constraint.
0 commit comments