File tree Expand file tree Collapse file tree 1 file changed +52
-1
lines changed Expand file tree Collapse file tree 1 file changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,55 @@ function foo(x, y) {
1212 case 4 :
1313 return 3 ;
1414 }
15- }
15+ }
16+
17+ declare function noop ( ) : void ;
18+ declare function fail ( ) : never ;
19+
20+ function f1 ( x : 0 | 1 | 2 ) {
21+ switch ( x ) {
22+ case 0 :
23+ fail ( ) ;
24+ case 1 :
25+ noop ( ) ;
26+ case 2 :
27+ return ;
28+ }
29+ }
30+
31+ // Repro from #34021
32+
33+ type Behavior = 'SLIDE' | 'SLIDE_OUT'
34+ type Direction = 'LEFT' | 'RIGHT' | 'TOP' | 'BOTTOM'
35+
36+ interface Transition {
37+ behavior : Behavior
38+ direction : Direction
39+ }
40+
41+ function f2 ( transition : Transition ) : any {
42+ switch ( transition . behavior ) {
43+ case 'SLIDE' :
44+ switch ( transition . direction ) {
45+ case 'LEFT' :
46+ return [ ]
47+ case 'RIGHT' :
48+ return [ ]
49+ case 'TOP' :
50+ return [ ]
51+ case 'BOTTOM' :
52+ return [ ]
53+ }
54+ case 'SLIDE_OUT' :
55+ switch ( transition . direction ) {
56+ case 'LEFT' :
57+ return [ ]
58+ case 'RIGHT' :
59+ return [ ]
60+ case 'TOP' :
61+ return [ ]
62+ case 'BOTTOM' :
63+ return [ ]
64+ }
65+ }
66+ }
You can’t perform that action at this time.
0 commit comments