File: stringLiteralTypesTypePredicates01.symbols

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (62 lines) | stat: -rw-r--r-- 3,324 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesTypePredicates01.ts ===
type Kind = "A" | "B"
>Kind : Symbol(Kind, Decl(stringLiteralTypesTypePredicates01.ts, 0, 0))

function kindIs(kind: Kind, is: "A"): kind is "A";
>kindIs : Symbol(kindIs, Decl(stringLiteralTypesTypePredicates01.ts, 0, 21), Decl(stringLiteralTypesTypePredicates01.ts, 2, 50), Decl(stringLiteralTypesTypePredicates01.ts, 3, 50))
>kind : Symbol(kind, Decl(stringLiteralTypesTypePredicates01.ts, 2, 16))
>Kind : Symbol(Kind, Decl(stringLiteralTypesTypePredicates01.ts, 0, 0))
>is : Symbol(is, Decl(stringLiteralTypesTypePredicates01.ts, 2, 27))
>kind : Symbol(kind, Decl(stringLiteralTypesTypePredicates01.ts, 2, 16))

function kindIs(kind: Kind, is: "B"): kind is "B";
>kindIs : Symbol(kindIs, Decl(stringLiteralTypesTypePredicates01.ts, 0, 21), Decl(stringLiteralTypesTypePredicates01.ts, 2, 50), Decl(stringLiteralTypesTypePredicates01.ts, 3, 50))
>kind : Symbol(kind, Decl(stringLiteralTypesTypePredicates01.ts, 3, 16))
>Kind : Symbol(Kind, Decl(stringLiteralTypesTypePredicates01.ts, 0, 0))
>is : Symbol(is, Decl(stringLiteralTypesTypePredicates01.ts, 3, 27))
>kind : Symbol(kind, Decl(stringLiteralTypesTypePredicates01.ts, 3, 16))

function kindIs(kind: Kind, is: Kind): boolean {
>kindIs : Symbol(kindIs, Decl(stringLiteralTypesTypePredicates01.ts, 0, 21), Decl(stringLiteralTypesTypePredicates01.ts, 2, 50), Decl(stringLiteralTypesTypePredicates01.ts, 3, 50))
>kind : Symbol(kind, Decl(stringLiteralTypesTypePredicates01.ts, 4, 16))
>Kind : Symbol(Kind, Decl(stringLiteralTypesTypePredicates01.ts, 0, 0))
>is : Symbol(is, Decl(stringLiteralTypesTypePredicates01.ts, 4, 27))
>Kind : Symbol(Kind, Decl(stringLiteralTypesTypePredicates01.ts, 0, 0))

    return kind === is;
>kind : Symbol(kind, Decl(stringLiteralTypesTypePredicates01.ts, 4, 16))
>is : Symbol(is, Decl(stringLiteralTypesTypePredicates01.ts, 4, 27))
}

var x: Kind = undefined;
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))
>Kind : Symbol(Kind, Decl(stringLiteralTypesTypePredicates01.ts, 0, 0))
>undefined : Symbol(undefined)

if (kindIs(x, "A")) {
>kindIs : Symbol(kindIs, Decl(stringLiteralTypesTypePredicates01.ts, 0, 21), Decl(stringLiteralTypesTypePredicates01.ts, 2, 50), Decl(stringLiteralTypesTypePredicates01.ts, 3, 50))
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))

    let a = x;
>a : Symbol(a, Decl(stringLiteralTypesTypePredicates01.ts, 11, 7))
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))
}
else {
    let b = x;
>b : Symbol(b, Decl(stringLiteralTypesTypePredicates01.ts, 14, 7))
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))
}

if (!kindIs(x, "B")) {
>kindIs : Symbol(kindIs, Decl(stringLiteralTypesTypePredicates01.ts, 0, 21), Decl(stringLiteralTypesTypePredicates01.ts, 2, 50), Decl(stringLiteralTypesTypePredicates01.ts, 3, 50))
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))

    let c = x;
>c : Symbol(c, Decl(stringLiteralTypesTypePredicates01.ts, 18, 7))
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))
}
else {
    let d = x;
>d : Symbol(d, Decl(stringLiteralTypesTypePredicates01.ts, 21, 7))
>x : Symbol(x, Decl(stringLiteralTypesTypePredicates01.ts, 8, 3))
}