v2 / vlib / v / tests / unreachable_code_paths_test.v
11 lines · 11 sloc · 137 bytes · 9e61321d4cb03d260260043f88ddae459048f1b2
Raw
1fn test_inside_ternary() {
2 x := if false {
3 'foo'
4 } else if true {
5 'bar'
6 } else {
7 panic('err')
8 'empty'
9 }
10 assert x == 'bar'
11}
12