mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
28 lines
1.0 KiB
Plaintext
28 lines
1.0 KiB
Plaintext
//// [tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts] ////
|
|
|
|
=== negateOperatorInvalidOperations.ts ===
|
|
// Unary operator -
|
|
|
|
// operand before -
|
|
var NUMBER1 = var NUMBER-; //expect error
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorInvalidOperations.ts, 3, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(negateOperatorInvalidOperations.ts, 3, 17), Decl(negateOperatorInvalidOperations.ts, 11, 3))
|
|
|
|
// invalid expressions
|
|
var NUMBER2 = -(null - undefined);
|
|
>NUMBER2 : Symbol(NUMBER2, Decl(negateOperatorInvalidOperations.ts, 6, 3))
|
|
>undefined : Symbol(undefined)
|
|
|
|
var NUMBER3 = -(null - null);
|
|
>NUMBER3 : Symbol(NUMBER3, Decl(negateOperatorInvalidOperations.ts, 7, 3))
|
|
|
|
var NUMBER4 = -(undefined - undefined);
|
|
>NUMBER4 : Symbol(NUMBER4, Decl(negateOperatorInvalidOperations.ts, 8, 3))
|
|
>undefined : Symbol(undefined)
|
|
>undefined : Symbol(undefined)
|
|
|
|
// miss operand
|
|
var NUMBER =-;
|
|
>NUMBER : Symbol(NUMBER, Decl(negateOperatorInvalidOperations.ts, 3, 17), Decl(negateOperatorInvalidOperations.ts, 11, 3))
|
|
|