The current ITE requires the branches to be variables:
bits[index] = if bit_num == 1 {true_val} else {false_val};
This restriction makes it inconvenient to use the ITE in noname. Ideally, we should allow expressions in the branches.
Examples for feature enhancement:
Allow literals
bits[index] = if bit_num == 1 {true} else {false};
num = if cond == true {1} else {0};
Allow expressions
let mut counter = 0;
// func_a and func_b has to return the same type
num = if cond == true {
counter = counter + 1;
func_a(counter);
} else {
func_b()
};
The current ITE requires the branches to be variables:
This restriction makes it inconvenient to use the ITE in noname. Ideally, we should allow expressions in the branches.
Examples for feature enhancement:
Allow literals
Allow expressions