2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithEnumType.ts ===
|
|
|
|
// delete operator on enum type
|
|
|
|
|
|
|
|
enum ENUM { };
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
2014-10-07 07:27:22 +02:00
|
|
|
enum ENUM1 { A, B, "" };
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1 : ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
|
|
|
>A : ENUM1, Symbol(ENUM1.A, Decl(deleteOperatorWithEnumType.ts, 3, 12))
|
|
|
|
>B : ENUM1, Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// enum type var
|
|
|
|
var ResultIsBoolean1 = delete ENUM;
|
2015-04-13 23:01:57 +02:00
|
|
|
>ResultIsBoolean1 : boolean, Symbol(ResultIsBoolean1, Decl(deleteOperatorWithEnumType.ts, 6, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>delete ENUM : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var ResultIsBoolean2 = delete ENUM1;
|
2015-04-13 23:01:57 +02:00
|
|
|
>ResultIsBoolean2 : boolean, Symbol(ResultIsBoolean2, Decl(deleteOperatorWithEnumType.ts, 7, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>delete ENUM1 : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// enum type expressions
|
2014-10-08 20:11:36 +02:00
|
|
|
var ResultIsBoolean3 = delete ENUM1["A"];
|
2015-04-13 23:01:57 +02:00
|
|
|
>ResultIsBoolean3 : boolean, Symbol(ResultIsBoolean3, Decl(deleteOperatorWithEnumType.ts, 10, 3))
|
2014-10-08 20:11:36 +02:00
|
|
|
>delete ENUM1["A"] : boolean
|
|
|
|
>ENUM1["A"] : ENUM1
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
|
|
|
>"A" : string, Symbol(ENUM1.A, Decl(deleteOperatorWithEnumType.ts, 3, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
2014-10-08 20:11:36 +02:00
|
|
|
var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]);
|
2015-04-13 23:01:57 +02:00
|
|
|
>ResultIsBoolean4 : boolean, Symbol(ResultIsBoolean4, Decl(deleteOperatorWithEnumType.ts, 11, 3))
|
2014-10-08 20:11:36 +02:00
|
|
|
>delete (ENUM[0] + ENUM1["B"]) : boolean
|
|
|
|
>(ENUM[0] + ENUM1["B"]) : string
|
|
|
|
>ENUM[0] + ENUM1["B"] : string
|
2014-08-15 23:33:16 +02:00
|
|
|
>ENUM[0] : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>0 : number
|
2014-10-08 20:11:36 +02:00
|
|
|
>ENUM1["B"] : ENUM1
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
|
|
|
>"B" : string, Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// multiple delete operators
|
|
|
|
var ResultIsBoolean5 = delete delete ENUM;
|
2015-04-13 23:01:57 +02:00
|
|
|
>ResultIsBoolean5 : boolean, Symbol(ResultIsBoolean5, Decl(deleteOperatorWithEnumType.ts, 14, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>delete delete ENUM : boolean
|
|
|
|
>delete ENUM : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
2014-10-08 20:11:36 +02:00
|
|
|
var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]);
|
2015-04-13 23:01:57 +02:00
|
|
|
>ResultIsBoolean6 : boolean, Symbol(ResultIsBoolean6, Decl(deleteOperatorWithEnumType.ts, 15, 3))
|
2014-10-08 20:11:36 +02:00
|
|
|
>delete delete delete (ENUM[0] + ENUM1["B"]) : boolean
|
|
|
|
>delete delete (ENUM[0] + ENUM1["B"]) : boolean
|
|
|
|
>delete (ENUM[0] + ENUM1["B"]) : boolean
|
|
|
|
>(ENUM[0] + ENUM1["B"]) : string
|
|
|
|
>ENUM[0] + ENUM1["B"] : string
|
2014-08-15 23:33:16 +02:00
|
|
|
>ENUM[0] : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
2015-04-13 21:36:11 +02:00
|
|
|
>0 : number
|
2014-10-08 20:11:36 +02:00
|
|
|
>ENUM1["B"] : ENUM1
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
|
|
|
>"B" : string, Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// miss assignment operators
|
|
|
|
delete ENUM;
|
|
|
|
>delete ENUM : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
delete ENUM1;
|
|
|
|
>delete ENUM1 : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
2014-10-08 20:11:36 +02:00
|
|
|
delete ENUM1.B;
|
|
|
|
>delete ENUM1.B : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM1.B : ENUM1, Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15))
|
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
|
|
|
>B : ENUM1, Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
delete ENUM, ENUM1;
|
|
|
|
>delete ENUM, ENUM1 : typeof ENUM1
|
|
|
|
>delete ENUM : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0))
|
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|