File: plusOperatorWithBooleanType.symbols

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (84 lines) | stat: -rw-r--r-- 3,341 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
=== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts ===
// + operator on boolean type
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(plusOperatorWithBooleanType.ts, 1, 3))

function foo(): boolean { return true; }
>foo : Symbol(foo, Decl(plusOperatorWithBooleanType.ts, 1, 21))

class A {
>A : Symbol(A, Decl(plusOperatorWithBooleanType.ts, 3, 40))

    public a: boolean;
>a : Symbol(A.a, Decl(plusOperatorWithBooleanType.ts, 5, 9))

    static foo() { return false; }
>foo : Symbol(A.foo, Decl(plusOperatorWithBooleanType.ts, 6, 22))
}
module M {
>M : Symbol(M, Decl(plusOperatorWithBooleanType.ts, 8, 1))

    export var n: boolean;
>n : Symbol(n, Decl(plusOperatorWithBooleanType.ts, 10, 14))
}

var objA = new A();
>objA : Symbol(objA, Decl(plusOperatorWithBooleanType.ts, 13, 3))
>A : Symbol(A, Decl(plusOperatorWithBooleanType.ts, 3, 40))

// boolean type var
var ResultIsNumber1 = +BOOLEAN;
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(plusOperatorWithBooleanType.ts, 16, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(plusOperatorWithBooleanType.ts, 1, 3))

// boolean type literal
var ResultIsNumber2 = +true;
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(plusOperatorWithBooleanType.ts, 19, 3))

var ResultIsNumber3 = +{ x: true, y: false };
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(plusOperatorWithBooleanType.ts, 20, 3))
>x : Symbol(x, Decl(plusOperatorWithBooleanType.ts, 20, 24))
>y : Symbol(y, Decl(plusOperatorWithBooleanType.ts, 20, 33))

// boolean type expressions
var ResultIsNumber4 = +objA.a;
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(plusOperatorWithBooleanType.ts, 23, 3))
>objA.a : Symbol(A.a, Decl(plusOperatorWithBooleanType.ts, 5, 9))
>objA : Symbol(objA, Decl(plusOperatorWithBooleanType.ts, 13, 3))
>a : Symbol(A.a, Decl(plusOperatorWithBooleanType.ts, 5, 9))

var ResultIsNumber5 = +M.n;
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(plusOperatorWithBooleanType.ts, 24, 3))
>M.n : Symbol(M.n, Decl(plusOperatorWithBooleanType.ts, 10, 14))
>M : Symbol(M, Decl(plusOperatorWithBooleanType.ts, 8, 1))
>n : Symbol(M.n, Decl(plusOperatorWithBooleanType.ts, 10, 14))

var ResultIsNumber6 = +foo();
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(plusOperatorWithBooleanType.ts, 25, 3))
>foo : Symbol(foo, Decl(plusOperatorWithBooleanType.ts, 1, 21))

var ResultIsNumber7 = +A.foo();
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(plusOperatorWithBooleanType.ts, 26, 3))
>A.foo : Symbol(A.foo, Decl(plusOperatorWithBooleanType.ts, 6, 22))
>A : Symbol(A, Decl(plusOperatorWithBooleanType.ts, 3, 40))
>foo : Symbol(A.foo, Decl(plusOperatorWithBooleanType.ts, 6, 22))

// miss assignment operators
+true;
+BOOLEAN;
>BOOLEAN : Symbol(BOOLEAN, Decl(plusOperatorWithBooleanType.ts, 1, 3))

+foo();
>foo : Symbol(foo, Decl(plusOperatorWithBooleanType.ts, 1, 21))

+true, false;
+objA.a;
>objA.a : Symbol(A.a, Decl(plusOperatorWithBooleanType.ts, 5, 9))
>objA : Symbol(objA, Decl(plusOperatorWithBooleanType.ts, 13, 3))
>a : Symbol(A.a, Decl(plusOperatorWithBooleanType.ts, 5, 9))

+M.n;
>M.n : Symbol(M.n, Decl(plusOperatorWithBooleanType.ts, 10, 14))
>M : Symbol(M, Decl(plusOperatorWithBooleanType.ts, 8, 1))
>n : Symbol(M.n, Decl(plusOperatorWithBooleanType.ts, 10, 14))