2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts ===
|
|
|
|
// - operator on enum type
|
|
|
|
|
|
|
|
enum ENUM { };
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM : ENUM, Symbol(ENUM,Decl(negateOperatorWithEnumType.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 22:54:22 +02:00
|
|
|
>ENUM1 : ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
|
|
|
>A : ENUM1, Symbol(ENUM1.A,Decl(negateOperatorWithEnumType.ts,3,12))
|
|
|
|
>B : ENUM1, Symbol(ENUM1.B,Decl(negateOperatorWithEnumType.ts,3,15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// enum type var
|
|
|
|
var ResultIsNumber1 = -ENUM;
|
2015-04-13 22:54:22 +02:00
|
|
|
>ResultIsNumber1 : number, Symbol(ResultIsNumber1,Decl(negateOperatorWithEnumType.ts,6,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>-ENUM : number
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM,Decl(negateOperatorWithEnumType.ts,0,0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// expressions
|
2014-10-08 20:11:36 +02:00
|
|
|
var ResultIsNumber2 = -ENUM1["B"];
|
2015-04-13 22:54:22 +02:00
|
|
|
>ResultIsNumber2 : number, Symbol(ResultIsNumber2,Decl(negateOperatorWithEnumType.ts,9,3))
|
2014-10-08 20:11:36 +02:00
|
|
|
>-ENUM1["B"] : number
|
|
|
|
>ENUM1["B"] : ENUM1
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
|
|
|
>"B" : string, Symbol(ENUM1.B,Decl(negateOperatorWithEnumType.ts,3,15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
2014-10-08 20:11:36 +02:00
|
|
|
var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]);
|
2015-04-13 22:54:22 +02:00
|
|
|
>ResultIsNumber3 : number, Symbol(ResultIsNumber3,Decl(negateOperatorWithEnumType.ts,10,3))
|
2014-10-08 20:11:36 +02:00
|
|
|
>-(ENUM1.B + ENUM1[""]) : number
|
|
|
|
>(ENUM1.B + ENUM1[""]) : number
|
|
|
|
>ENUM1.B + ENUM1[""] : number
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM1.B : ENUM1, Symbol(ENUM1.B,Decl(negateOperatorWithEnumType.ts,3,15))
|
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
|
|
|
>B : ENUM1, Symbol(ENUM1.B,Decl(negateOperatorWithEnumType.ts,3,15))
|
2014-10-08 20:11:36 +02:00
|
|
|
>ENUM1[""] : ENUM1
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
|
|
|
>"" : string, Symbol(ENUM1."",Decl(negateOperatorWithEnumType.ts,3,18))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// miss assignment operators
|
|
|
|
-ENUM;
|
|
|
|
>-ENUM : number
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM,Decl(negateOperatorWithEnumType.ts,0,0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
-ENUM1;
|
|
|
|
>-ENUM1 : number
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
2014-10-08 20:11:36 +02:00
|
|
|
-ENUM1["B"];
|
|
|
|
>-ENUM1["B"] : number
|
|
|
|
>ENUM1["B"] : ENUM1
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
|
|
|
>"B" : string, Symbol(ENUM1.B,Decl(negateOperatorWithEnumType.ts,3,15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
-ENUM, ENUM1;
|
|
|
|
>-ENUM, ENUM1 : typeof ENUM1
|
|
|
|
>-ENUM : number
|
2015-04-13 22:54:22 +02:00
|
|
|
>ENUM : typeof ENUM, Symbol(ENUM,Decl(negateOperatorWithEnumType.ts,0,0))
|
|
|
|
>ENUM1 : typeof ENUM1, Symbol(ENUM1,Decl(negateOperatorWithEnumType.ts,2,14))
|
2014-08-15 23:33:16 +02:00
|
|
|
|