You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prohibit using Exit For Loop and Continue For Loop in keywords #4185
Currently it is possible to use Exit For Loop and Continue For Loop keywords not only inside FOR loops but also in keywords used by loops. For example, this is possible:
*** Keywords ***
Looping
FOR ${x} IN @{stuff}
Keyword
END
Keyword
Exit For Loop
This kind of loop control that can happen outside loops can be really hard to understand and can create a big mess. It is also not something that other languages like Python support. When designing native BREAK and CONTINUE (#4079) to replace these keywords, we agreed not to support them inside keywords. To simplify implementation and to have just one "rules" for loop control, we also decided to prohibit Exit For Loop and Continue For Loop in keywords.
This change is naturally backwards incompatible and affects everyone who has used these keywords inside keywords, not directly inside loops. We try to avoid such changes in general, but we believe that's fine in this case for the following reasons:
As already mentioned, it's good that these keywords work the same way as BREAK and CONTINUE. And we don't want BREAK and CONTINUE to work inside keywords.
The plan is to deprecate and remove these keywords in favor of BREAK and CONTINUE. Everyone eventually needs to change their tests/tasks anyway.
The change happens in a major release where breaking changes are more ok than in other releases.
Activity
Prohibit loop control outside loops.