1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix if expression

This commit is contained in:
れもん
2019-11-23 20:25:57 +09:00
committed by Alexander Medvednikov
parent 0382331499
commit 3d235169c8
2 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,14 @@
fn test_if_expression_precedence_false_condition(){
b := 10
c := 20
res := 1 + if b > c { b } else { c } + 1
assert res == c + 2
}
fn test_if_expression_precedence_true_condition(){
b := 20
c := 10
res := 1 + if b > c { b } else { c } + 1
assert res == b + 2
}