-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
103 additions
and
103 deletions.
There are no files selected for viewing
46 changes: 23 additions & 23 deletions
46
tests/baselines/reference/decrementOperatorWithEnumType.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. | ||
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. | ||
|
||
|
||
==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts (3 errors) ==== | ||
// -- operator on enum type | ||
|
||
enum ENUM1 { A, B, "" }; | ||
|
||
// expression | ||
var ResultIsNumber1 = --ENUM1["A"]; | ||
var ResultIsNumber2 = ENUM1.A--; | ||
~~~~~~~ | ||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
|
||
// miss assignment operator | ||
--ENUM1["A"]; | ||
|
||
ENUM1[A]--; | ||
~~~~~~~~ | ||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. | ||
~ | ||
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. | ||
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. | ||
==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts (3 errors) ==== | ||
// -- operator on enum type | ||
enum ENUM1 { A, B, "" }; | ||
// expression | ||
var ResultIsNumber1 = --ENUM1["A"]; | ||
var ResultIsNumber2 = ENUM1.A--; | ||
~~~~~~~ | ||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
// miss assignment operator | ||
--ENUM1["A"]; | ||
ENUM1[A]--; | ||
~~~~~~~~ | ||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. | ||
~ | ||
!!! error TS2304: Cannot find name 'A'. |
48 changes: 24 additions & 24 deletions
48
tests/baselines/reference/enumIdentifierLiterals.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
tests/cases/compiler/enumIdentifierLiterals.ts(2,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(3,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(4,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(5,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(6,5): error TS1151: An enum member cannot have a numeric name. | ||
|
||
|
||
==== tests/cases/compiler/enumIdentifierLiterals.ts (5 errors) ==== | ||
enum Nums { | ||
1.0, | ||
~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
11e-1, | ||
~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
0.12e1, | ||
~~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
"13e-1", | ||
~~~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
0xF00D | ||
~~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(2,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(3,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(4,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(5,5): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/compiler/enumIdentifierLiterals.ts(6,5): error TS1151: An enum member cannot have a numeric name. | ||
==== tests/cases/compiler/enumIdentifierLiterals.ts (5 errors) ==== | ||
enum Nums { | ||
1.0, | ||
~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
11e-1, | ||
~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
0.12e1, | ||
~~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
"13e-1", | ||
~~~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
0xF00D | ||
~~~~~~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
//// [enumIdentifierLiterals.ts] | ||
//// [enumIdentifierLiterals.ts] | ||
enum Nums { | ||
1.0, | ||
11e-1, | ||
0.12e1, | ||
"13e-1", | ||
0xF00D | ||
} | ||
|
||
//// [enumIdentifierLiterals.js] | ||
var Nums; | ||
(function (Nums) { | ||
Nums[Nums["1"] = 0] = "1"; | ||
Nums[Nums["1.1"] = 1] = "1.1"; | ||
Nums[Nums["1.2"] = 2] = "1.2"; | ||
Nums[Nums["13e-1"] = 3] = "13e-1"; | ||
Nums[Nums["61453"] = 4] = "61453"; | ||
})(Nums || (Nums = {})); | ||
} | ||
|
||
//// [enumIdentifierLiterals.js] | ||
var Nums; | ||
(function (Nums) { | ||
Nums[Nums["1"] = 0] = "1"; | ||
Nums[Nums["1.1"] = 1] = "1.1"; | ||
Nums[Nums["1.2"] = 2] = "1.2"; | ||
Nums[Nums["13e-1"] = 3] = "13e-1"; | ||
Nums[Nums["61453"] = 4] = "61453"; | ||
})(Nums || (Nums = {})); |
40 changes: 20 additions & 20 deletions
40
tests/baselines/reference/incrementOperatorWithEnumType.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
|
||
|
||
==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (2 errors) ==== | ||
// ++ operator on enum type | ||
|
||
enum ENUM1 { A, B, "" }; | ||
|
||
// expression | ||
var ResultIsNumber1 = ++ENUM1["B"]; | ||
var ResultIsNumber2 = ENUM1.B++; | ||
~~~~~~~ | ||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
|
||
// miss assignment operator | ||
++ENUM1["B"]; | ||
|
||
ENUM1.B++; | ||
~~~~~~~ | ||
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,23): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,1): error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (2 errors) ==== | ||
// ++ operator on enum type | ||
enum ENUM1 { A, B, "" }; | ||
// expression | ||
var ResultIsNumber1 = ++ENUM1["B"]; | ||
var ResultIsNumber2 = ENUM1.B++; | ||
~~~~~~~ | ||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. | ||
// miss assignment operator | ||
++ENUM1["B"]; | ||
ENUM1.B++; | ||
~~~~~~~ | ||
!!! error TS2357: The operand of an increment or decrement operator must be a variable, property or indexer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts(2,3): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts(2,6): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts(2,9): error TS1151: An enum member cannot have a numeric name. | ||
|
||
|
||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts (3 errors) ==== | ||
enum E { | ||
1, 2, 3 | ||
~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts(2,3): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts(2,6): error TS1151: An enum member cannot have a numeric name. | ||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts(2,9): error TS1151: An enum member cannot have a numeric name. | ||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum7.ts (3 errors) ==== | ||
enum E { | ||
1, 2, 3 | ||
~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
~ | ||
!!! error TS1151: An enum member cannot have a numeric name. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
//// [parserEnum7.ts] | ||
//// [parserEnum7.ts] | ||
enum E { | ||
1, 2, 3 | ||
} | ||
|
||
//// [parserEnum7.js] | ||
var E; | ||
(function (E) { | ||
E[E["1"] = 0] = "1"; | ||
E[E["2"] = 1] = "2"; | ||
E[E["3"] = 2] = "3"; | ||
})(E || (E = {})); | ||
} | ||
|
||
//// [parserEnum7.js] | ||
var E; | ||
(function (E) { | ||
E[E["1"] = 0] = "1"; | ||
E[E["2"] = 1] = "2"; | ||
E[E["3"] = 2] = "3"; | ||
})(E || (E = {})); |