Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"break" exits all(?) outer "for loops" #17

Closed
vidya88 opened this issue Sep 23, 2019 · 0 comments
Closed

"break" exits all(?) outer "for loops" #17

vidya88 opened this issue Sep 23, 2019 · 0 comments

Comments

@vidya88
Copy link

vidya88 commented Sep 23, 2019

@corpusc commented on Jul 26

To Reproduce

  1. use the following code:

package main

func main() {
for h := 0; h < 5; h++ {
for i := 0; i < 5; i++ {
for j := 0; j < 5; j++ {
break
printf("j: %d \n", j)
}

  str.print("out of j loop")
}

str.print("out of i loop")

}

str.print("out of h loop")
}

  1. notice only the last print "out of h loop" happens

Expected behavior

all 3 "out of _" print statements should be run. j, i then h.

Desktop (please complete the following information):

  • OS: Windows 10
  • CX Version: 0.7.0 full release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants