From 21432e8965403975a3f8e9175a46430b7b818241 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 9 Mar 2025 09:52:54 +0100 Subject: Codegen: Fix bug with if statements inside while loops --- examples/10.src | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/10.src b/examples/10.src index b840849..59f91e1 100644 --- a/examples/10.src +++ b/examples/10.src @@ -6,9 +6,11 @@ let main = () => i64 { counter = counter + 1; }; - while counter % 3 == 0 { - print(0); + while true { + if counter == 10 { + return counter; + }; }; - return counter; + return 1; }; -- cgit 1.4.1