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
if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) {
40785
+
if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type)) {
40786
40786
return true;
40787
40787
}
40788
40788
if (languageVersion < ScriptTarget.ES2015 && isPrivateIdentifier(node.name)) {
Copy file name to clipboardExpand all lines: tests/baselines/reference/awaitAndYieldInProperty.errors.txt
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(3,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
1
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(3,9): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
2
2
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(3,21): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
3
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(4,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
3
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(4,16): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
4
4
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(4,28): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
5
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(6,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
5
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(6,9): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
6
6
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(6,21): error TS1163: A 'yield' expression is only allowed in a generator body.
7
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(7,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
7
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(7,16): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
8
8
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(7,28): error TS1163: A 'yield' expression is only allowed in a generator body.
9
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(11,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
9
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(11,9): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
10
10
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(11,21): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
11
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(12,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
11
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(12,16): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
12
12
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(12,28): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
13
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(14,9): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
13
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(14,9): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
14
14
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(14,21): error TS1163: A 'yield' expression is only allowed in a generator body.
15
-
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(15,16): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
15
+
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(15,16): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
16
16
tests/cases/conformance/classes/awaitAndYieldInProperty.ts(15,28): error TS1163: A 'yield' expression is only allowed in a generator body.
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
24
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
25
25
~~~~~
26
26
!!! error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
27
27
static [await x] = await x;
28
28
~~~~~~~~~
29
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
29
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
30
30
~~~~~
31
31
!!! error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
32
32
33
33
[yield 1] = yield 2;
34
34
~~~~~~~~~
35
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
35
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
36
36
~~~~~
37
37
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
38
38
static [yield 3] = yield 4;
39
39
~~~~~~~~~
40
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
40
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
41
41
~~~~~
42
42
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
43
43
}
44
44
45
45
return class {
46
46
[await x] = await x;
47
47
~~~~~~~~~
48
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
48
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
49
49
~~~~~
50
50
!!! error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
51
51
static [await x] = await x;
52
52
~~~~~~~~~
53
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
53
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
54
54
~~~~~
55
55
!!! error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules.
56
56
57
57
[yield 1] = yield 2;
58
58
~~~~~~~~~
59
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
59
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
60
60
~~~~~
61
61
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
62
62
static [yield 3] = yield 4;
63
63
~~~~~~~~~
64
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
64
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
65
65
~~~~~
66
66
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
Copy file name to clipboardExpand all lines: tests/baselines/reference/capturedParametersInInitializers2.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
tests/cases/compiler/capturedParametersInInitializers2.ts(3,20): error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
2
2
tests/cases/compiler/capturedParametersInInitializers2.ts(4,14): error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
3
3
tests/cases/compiler/capturedParametersInInitializers2.ts(6,10): error TS2373: Parameter 'y' cannot reference identifier 'z' declared after it.
4
-
tests/cases/compiler/capturedParametersInInitializers2.ts(13,26): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
4
+
tests/cases/compiler/capturedParametersInInitializers2.ts(13,26): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
5
5
tests/cases/compiler/capturedParametersInInitializers2.ts(13,27): error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
29
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
30
30
~
31
31
!!! error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(5,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
2
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(6,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
3
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
4
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
5
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
6
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(12,5): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
7
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
8
-
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
1
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(5,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
2
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(6,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
3
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
4
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
5
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
6
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(12,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
7
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
8
+
tests/cases/conformance/es6/computedProperties/computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
18
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
19
19
[n] = n;
20
20
~~~
21
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
21
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
22
22
static [s + s]: string;
23
23
~~~~~~~
24
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
24
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
25
25
[s + n] = 2;
26
26
~~~~~~~
27
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
27
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
28
28
[+s]: typeof s;
29
29
~~~~
30
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
30
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
31
31
static [""]: number;
32
32
[0]: number;
33
33
[a]: number;
34
34
~~~
35
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
35
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
36
36
static [<any>true]: number;
37
37
~~~~~~~~~~~
38
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
38
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
39
39
[`hello bye`] = 0;
40
40
static [`hello ${a} bye`] = 0
41
41
~~~~~~~~~~~~~~~~~~
42
-
!!! error TS1166: A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.
42
+
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
0 commit comments