Closed poorna2152 closed 2 years ago
Following needs to be fixed,
import ballerina/io;
public function main() { foo(); }
function foo() { boolean b = false; while b { io:println(0); } }
<img width="294" alt="while08" src="https://user-images.githubusercontent.com/58025190/169445583-5a8c3ca0-198e-4600-9ba2-35b8e4606ba4.PNG">
2. [while10-v.bal](https://github.com/poorna2152/nballerina/blob/main/compiler/testSuite/01-loop/while10-v.bal)
import ballerina/io;
public function main() { int i = 0; while true { if !(i < 3) { break; } io:println(i); i = i + 1; } }
<img width="259" alt="while10" src="https://user-images.githubusercontent.com/58025190/169445694-c38e6be1-dcfd-41a3-ac3f-9e5d65fa287b.PNG">
To fix:
REGION_COND
need to be changed.Either have to create Regions when generating doing codegen or have to create regions after all blocks are created by traversing the graph