60 lines
2.8 KiB
Text
60 lines
2.8 KiB
Text
=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts ===
|
|
// ! operator on enum type
|
|
|
|
enum ENUM { A, B, C };
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>A : Symbol(ENUM.A, Decl(logicalNotOperatorWithEnumType.ts, 2, 11))
|
|
>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
>C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17))
|
|
|
|
enum ENUM1 { };
|
|
>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22))
|
|
|
|
// enum type var
|
|
var ResultIsBoolean1 = !ENUM;
|
|
>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithEnumType.ts, 6, 3))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
|
|
// enum type expressions
|
|
var ResultIsBoolean2 = !ENUM["B"];
|
|
>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithEnumType.ts, 9, 3))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>"B" : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
|
|
var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]);
|
|
>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithEnumType.ts, 10, 3))
|
|
>ENUM.B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>"C" : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17))
|
|
|
|
// multiple ! operators
|
|
var ResultIsBoolean4 = !!ENUM;
|
|
>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithEnumType.ts, 13, 3))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
|
|
var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C);
|
|
>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithEnumType.ts, 14, 3))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>"B" : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
>ENUM.C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17))
|
|
|
|
// miss assignment operators
|
|
!ENUM;
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
|
|
!ENUM1;
|
|
>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22))
|
|
|
|
!ENUM.B;
|
|
>ENUM.B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14))
|
|
|
|
!ENUM, ENUM1;
|
|
>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0))
|
|
>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22))
|
|
|