mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix VUNREACHABLE inside ternary (#10672)
This commit is contained in:
11
vlib/v/tests/unreachable_code_paths_test.v
Normal file
11
vlib/v/tests/unreachable_code_paths_test.v
Normal file
@@ -0,0 +1,11 @@
|
||||
fn test_inside_ternary() {
|
||||
x := if false {
|
||||
'foo'
|
||||
} else if true {
|
||||
'bar'
|
||||
} else {
|
||||
panic('err')
|
||||
'empty'
|
||||
}
|
||||
assert x == 'bar'
|
||||
}
|
||||
Reference in New Issue
Block a user