diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt index d43515e84ef6e..a0c30e9dc93fa 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -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'. \ No newline at end of file diff --git a/tests/baselines/reference/enumIdentifierLiterals.errors.txt b/tests/baselines/reference/enumIdentifierLiterals.errors.txt index 721a6bd29ff11..6327e40289ac0 100644 --- a/tests/baselines/reference/enumIdentifierLiterals.errors.txt +++ b/tests/baselines/reference/enumIdentifierLiterals.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/enumIdentifierLiterals.js b/tests/baselines/reference/enumIdentifierLiterals.js index 06cb76dd21d83..72a8a56570c8b 100644 --- a/tests/baselines/reference/enumIdentifierLiterals.js +++ b/tests/baselines/reference/enumIdentifierLiterals.js @@ -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 = {})); diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt index 7617dbba379b3..9bcf6c7612f66 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt @@ -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. \ No newline at end of file diff --git a/tests/baselines/reference/parserEnum7.errors.txt b/tests/baselines/reference/parserEnum7.errors.txt index 48c938e02de55..a4a2326546a05 100644 --- a/tests/baselines/reference/parserEnum7.errors.txt +++ b/tests/baselines/reference/parserEnum7.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/parserEnum7.js b/tests/baselines/reference/parserEnum7.js index 831090f4ce782..3781167bbbaff 100644 --- a/tests/baselines/reference/parserEnum7.js +++ b/tests/baselines/reference/parserEnum7.js @@ -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 = {}));