File: undefinedAsDiscriminantWithUnknown%28strictnullchecks%3Dtrue%29.symbols

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (36 lines) | stat: -rw-r--r-- 1,731 bytes parent folder | download | duplicates (6)
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
=== tests/cases/compiler/undefinedAsDiscriminantWithUnknown.ts ===
type S = 
>S : Symbol(S, Decl(undefinedAsDiscriminantWithUnknown.ts, 0, 0))

| { type: 'string', value: string } 
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 3))
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19))

| { type: 'number', value: number } 
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 3))
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19))

| { type: 'unknown', value: unknown }
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 3))
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20))

| { value: undefined };
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3))

declare var s: S
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11))
>S : Symbol(S, Decl(undefinedAsDiscriminantWithUnknown.ts, 0, 0))

if (s.value !== undefined) {
>s.value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20), Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3))
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11))
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20), Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3))
>undefined : Symbol(undefined)

  s;
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11))
}
else {
  s;
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11))
}