84 lines
1.9 KiB
Text
84 lines
1.9 KiB
Text
=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithEnumType.ts ===
|
|
// delete operator on enum type
|
|
|
|
enum ENUM { };
|
|
>ENUM : ENUM
|
|
|
|
enum ENUM1 { A, B, "" };
|
|
>ENUM1 : ENUM1
|
|
>A : ENUM1
|
|
>B : ENUM1
|
|
|
|
// enum type var
|
|
var ResultIsBoolean1 = delete ENUM;
|
|
>ResultIsBoolean1 : boolean
|
|
>delete ENUM : boolean
|
|
>ENUM : typeof ENUM
|
|
|
|
var ResultIsBoolean2 = delete ENUM1;
|
|
>ResultIsBoolean2 : boolean
|
|
>delete ENUM1 : boolean
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
// enum type expressions
|
|
var ResultIsBoolean3 = delete ENUM1["A"];
|
|
>ResultIsBoolean3 : boolean
|
|
>delete ENUM1["A"] : boolean
|
|
>ENUM1["A"] : ENUM1
|
|
>ENUM1 : typeof ENUM1
|
|
>"A" : string
|
|
|
|
var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]);
|
|
>ResultIsBoolean4 : boolean
|
|
>delete (ENUM[0] + ENUM1["B"]) : boolean
|
|
>(ENUM[0] + ENUM1["B"]) : string
|
|
>ENUM[0] + ENUM1["B"] : string
|
|
>ENUM[0] : string
|
|
>ENUM : typeof ENUM
|
|
>0 : number
|
|
>ENUM1["B"] : ENUM1
|
|
>ENUM1 : typeof ENUM1
|
|
>"B" : string
|
|
|
|
// multiple delete operators
|
|
var ResultIsBoolean5 = delete delete ENUM;
|
|
>ResultIsBoolean5 : boolean
|
|
>delete delete ENUM : boolean
|
|
>delete ENUM : boolean
|
|
>ENUM : typeof ENUM
|
|
|
|
var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]);
|
|
>ResultIsBoolean6 : boolean
|
|
>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
|
|
>ENUM[0] : string
|
|
>ENUM : typeof ENUM
|
|
>0 : number
|
|
>ENUM1["B"] : ENUM1
|
|
>ENUM1 : typeof ENUM1
|
|
>"B" : string
|
|
|
|
// miss assignment operators
|
|
delete ENUM;
|
|
>delete ENUM : boolean
|
|
>ENUM : typeof ENUM
|
|
|
|
delete ENUM1;
|
|
>delete ENUM1 : boolean
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
delete ENUM1.B;
|
|
>delete ENUM1.B : boolean
|
|
>ENUM1.B : ENUM1
|
|
>ENUM1 : typeof ENUM1
|
|
>B : ENUM1
|
|
|
|
delete ENUM, ENUM1;
|
|
>delete ENUM, ENUM1 : typeof ENUM1
|
|
>delete ENUM : boolean
|
|
>ENUM : typeof ENUM
|
|
>ENUM1 : typeof ENUM1
|
|
|