127 lines
5.7 KiB
Text
127 lines
5.7 KiB
Text
=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts ===
|
|
// ! operator on number type
|
|
var NUMBER: number;
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
|
|
var NUMBER1: number[] = [1, 2];
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3))
|
|
|
|
function foo(): number { return 1; }
|
|
>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31))
|
|
|
|
class A {
|
|
>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36))
|
|
|
|
public a: number;
|
|
>a : Symbol(a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
|
|
static foo() { return 1; }
|
|
>foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21))
|
|
}
|
|
module M {
|
|
>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1))
|
|
|
|
export var n: number;
|
|
>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
}
|
|
|
|
var objA = new A();
|
|
>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3))
|
|
>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36))
|
|
|
|
// number type var
|
|
var ResultIsBoolean1 = !NUMBER;
|
|
>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithNumberType.ts, 17, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
|
|
var ResultIsBoolean2 = !NUMBER1;
|
|
>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithNumberType.ts, 18, 3))
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3))
|
|
|
|
// number type literal
|
|
var ResultIsBoolean3 = !1;
|
|
>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithNumberType.ts, 21, 3))
|
|
|
|
var ResultIsBoolean4 = !{ x: 1, y: 2};
|
|
>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithNumberType.ts, 22, 3))
|
|
>x : Symbol(x, Decl(logicalNotOperatorWithNumberType.ts, 22, 25))
|
|
>y : Symbol(y, Decl(logicalNotOperatorWithNumberType.ts, 22, 31))
|
|
|
|
var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } };
|
|
>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithNumberType.ts, 23, 3))
|
|
>x : Symbol(x, Decl(logicalNotOperatorWithNumberType.ts, 23, 25))
|
|
>y : Symbol(y, Decl(logicalNotOperatorWithNumberType.ts, 23, 31))
|
|
>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 23, 36))
|
|
>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 23, 36))
|
|
|
|
// number type expressions
|
|
var ResultIsBoolean6 = !objA.a;
|
|
>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithNumberType.ts, 26, 3))
|
|
>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
|
|
var ResultIsBoolean7 = !M.n;
|
|
>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithNumberType.ts, 27, 3))
|
|
>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
|
|
var ResultIsBoolean8 = !NUMBER1[0];
|
|
>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(logicalNotOperatorWithNumberType.ts, 28, 3))
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3))
|
|
|
|
var ResultIsBoolean9 = !foo();
|
|
>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(logicalNotOperatorWithNumberType.ts, 29, 3))
|
|
>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31))
|
|
|
|
var ResultIsBoolean10 = !A.foo();
|
|
>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(logicalNotOperatorWithNumberType.ts, 30, 3))
|
|
>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21))
|
|
>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36))
|
|
>foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21))
|
|
|
|
var ResultIsBoolean11 = !(NUMBER + NUMBER);
|
|
>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(logicalNotOperatorWithNumberType.ts, 31, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
|
|
// multiple ! operator
|
|
var ResultIsBoolean12 = !!NUMBER;
|
|
>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(logicalNotOperatorWithNumberType.ts, 34, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
|
|
var ResultIsBoolean13 = !!!(NUMBER + NUMBER);
|
|
>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(logicalNotOperatorWithNumberType.ts, 35, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
|
|
// miss assignment operators
|
|
!1;
|
|
!NUMBER;
|
|
>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3))
|
|
|
|
!NUMBER1;
|
|
>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3))
|
|
|
|
!foo();
|
|
>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31))
|
|
|
|
!objA.a;
|
|
>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
|
|
!M.n;
|
|
>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
|
|
!objA.a, M.n;
|
|
>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3))
|
|
>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9))
|
|
>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1))
|
|
>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14))
|
|
|