I don’t have any practical experience with the new validator yet so can’t speak to whether this would still be allowed, but I believe
break, contrary to what one would expect, actually exits the rule, not just the current context. But I learned that way back on 1.7, that behavior may be different now. And even then that was me trying to use a break in a lambda, not the main part of the rule.
I personally always structure my rules so there is only one exit (it’s the coding standard at my first job and it stuck) so I don’t really have much experience with return statements in rules.
The error implies to me that the rule is treated as a function with no return value. I would try
return void to see if that makes the parsers and the code happier. Otherwise living with the warnings or restructuring the roles may be required.