File: stringLiteralTypesInUnionTypes02.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 (53 lines) | stat: -rw-r--r-- 2,048 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
=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes02.ts ===
type T = string | "foo" | "bar" | "baz";
>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes02.ts, 0, 0))

var x: "foo" | "bar" | "baz" | string = undefined;
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))
>undefined : Symbol(undefined)

var y: T = undefined;
>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3))
>T : Symbol(T, Decl(stringLiteralTypesInUnionTypes02.ts, 0, 0))
>undefined : Symbol(undefined)

if (x === "foo") {
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))

    let a = x;
>a : Symbol(a, Decl(stringLiteralTypesInUnionTypes02.ts, 6, 7))
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))
}
else if (x !== "bar") {
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))

    let b = x || y;
>b : Symbol(b, Decl(stringLiteralTypesInUnionTypes02.ts, 9, 7))
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))
>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3))
}
else {
    let c = x;
>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes02.ts, 12, 7))
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))

    let d = y;
>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes02.ts, 13, 7))
>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3))

    let e: (typeof x) | (typeof y) = c || d;
>e : Symbol(e, Decl(stringLiteralTypesInUnionTypes02.ts, 14, 7))
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))
>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3))
>c : Symbol(c, Decl(stringLiteralTypesInUnionTypes02.ts, 12, 7))
>d : Symbol(d, Decl(stringLiteralTypesInUnionTypes02.ts, 13, 7))
}

x = y;
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))
>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3))

y = x;
>y : Symbol(y, Decl(stringLiteralTypesInUnionTypes02.ts, 3, 3))
>x : Symbol(x, Decl(stringLiteralTypesInUnionTypes02.ts, 2, 3))