File: stringLiteralTypeAssertion01.types

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 (107 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download | duplicates (2)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
=== tests/cases/conformance/types/stringLiteral/stringLiteralTypeAssertion01.ts ===

type S = "a" | "b";
>S : S

type T = S[] | S;
>T : T
>S : S
>S : S

var s: S;
>s : S
>S : S

var t: T;
>t : T
>T : T

var str: string;
>str : string

////////////////

s = <S>t;
>s = <S>t : S
>s : S
><S>t : S
>S : S
>t : T

s = t as S;
>s = t as S : S
>s : S
>t as S : S
>t : T
>S : S

s = <S>str;
>s = <S>str : S
>s : S
><S>str : S
>S : S
>str : string

s = str as S;
>s = str as S : S
>s : S
>str as S : S
>str : string
>S : S

////////////////

t = <T>s;
>t = <T>s : T
>t : T
><T>s : T
>T : T
>s : S

t = s as T;
>t = s as T : T
>t : T
>s as T : T
>s : S
>T : T

t = <T>str;
>t = <T>str : T
>t : T
><T>str : T
>T : T
>str : string

t = str as T;
>t = str as T : T
>t : T
>str as T : T
>str : string
>T : T

////////////////

str = <string>s;
>str = <string>s : string
>str : string
><string>s : string
>s : S

str = s as string;
>str = s as string : string
>str : string
>s as string : string
>s : S

str = <string>t;
>str = <string>t : string
>str : string
><string>t : string
>t : T

str = t as string;
>str = t as string : string
>str : string
>t as string : string
>t : T