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
Copy file name to clipboardExpand all lines: tests/baselines/reference/mappedTypeProperties.errors.txt
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,19 @@ mappedTypeProperties.ts(23,5): error TS7061: A mapped type may not declare prope
6
6
mappedTypeProperties.ts(27,5): error TS7061: A mapped type may not declare properties or methods.
7
7
mappedTypeProperties.ts(31,5): error TS7061: A mapped type may not declare properties or methods.
8
8
mappedTypeProperties.ts(34,5): error TS7061: A mapped type may not declare properties or methods.
9
+
mappedTypeProperties.ts(34,6): error TS2304: Cannot find name 'P'.
10
+
mappedTypeProperties.ts(34,11): error TS2693: 'PlaceType' only refers to a type, but is being used as a value here.
9
11
mappedTypeProperties.ts(37,5): error TS7061: A mapped type may not declare properties or methods.
12
+
mappedTypeProperties.ts(37,6): error TS2304: Cannot find name 'P'.
13
+
mappedTypeProperties.ts(37,11): error TS2693: 'PlaceType' only refers to a type, but is being used as a value here.
10
14
mappedTypeProperties.ts(40,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
11
15
mappedTypeProperties.ts(40,6): error TS2304: Cannot find name 'P'.
12
16
mappedTypeProperties.ts(40,6): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
13
17
mappedTypeProperties.ts(40,11): error TS2322: Type 'string' is not assignable to type 'object'.
14
18
mappedTypeProperties.ts(40,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
15
19
16
20
17
-
==== mappedTypeProperties.ts (14 errors) ====
21
+
==== mappedTypeProperties.ts (18 errors) ====
18
22
export type PlaceType = 'openSky' | 'roofed' | 'garage'
19
23
type Before = {
20
24
model: 'hour' | 'day';
@@ -65,11 +69,19 @@ mappedTypeProperties.ts(40,17): error TS2363: The right-hand side of an arithmet
65
69
[P in PlaceType]: any
66
70
~~~~~~~~~~~~~~~~
67
71
!!! error TS7061: A mapped type may not declare properties or methods.
72
+
~
73
+
!!! error TS2304: Cannot find name 'P'.
74
+
~~~~~~~~~
75
+
!!! error TS2693: 'PlaceType' only refers to a type, but is being used as a value here.
68
76
}
69
77
const D = class {
70
78
[P in PlaceType]: any
71
79
~~~~~~~~~~~~~~~~
72
80
!!! error TS7061: A mapped type may not declare properties or methods.
81
+
~
82
+
!!! error TS2304: Cannot find name 'P'.
83
+
~~~~~~~~~
84
+
!!! error TS2693: 'PlaceType' only refers to a type, but is being used as a value here.
0 commit comments