File: typePredicatesInUnion.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (40 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (5)
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
=== tests/cases/compiler/typePredicatesInUnion.ts ===
interface A {
>A : Symbol(A, Decl(typePredicatesInUnion.ts, 0, 0))

    pred(x: {}): x is boolean;
>pred : Symbol(A.pred, Decl(typePredicatesInUnion.ts, 0, 13))
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 1, 9))
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 1, 9))
}
interface B {
>B : Symbol(B, Decl(typePredicatesInUnion.ts, 2, 1))

    pred(x: {}): x is string;
>pred : Symbol(B.pred, Decl(typePredicatesInUnion.ts, 3, 13))
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 4, 9))
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 4, 9))
}

type Or = A | B;
>Or : Symbol(Or, Decl(typePredicatesInUnion.ts, 5, 1))
>A : Symbol(A, Decl(typePredicatesInUnion.ts, 0, 0))
>B : Symbol(B, Decl(typePredicatesInUnion.ts, 2, 1))

function f(o: Or, x: {}) {
>f : Symbol(f, Decl(typePredicatesInUnion.ts, 7, 16))
>o : Symbol(o, Decl(typePredicatesInUnion.ts, 9, 11))
>Or : Symbol(Or, Decl(typePredicatesInUnion.ts, 5, 1))
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 9, 17))

    if (o.pred(x)) {
>o.pred : Symbol(pred, Decl(typePredicatesInUnion.ts, 0, 13), Decl(typePredicatesInUnion.ts, 3, 13))
>o : Symbol(o, Decl(typePredicatesInUnion.ts, 9, 11))
>pred : Symbol(pred, Decl(typePredicatesInUnion.ts, 0, 13), Decl(typePredicatesInUnion.ts, 3, 13))
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 9, 17))

        x;
>x : Symbol(x, Decl(typePredicatesInUnion.ts, 9, 17))
    }
}