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
Lint : Check reachable labels with required parameters #5318
base: master
Are you sure you want to change the base?
Conversation
This is weird since it's one rare kind of statement which should *not* be reachable
It may not be pretty, but this is entirely legal and functional: label start:
call a(1)
call alternate_greeting(2)
return
label a(foo=1):
"Hello [foo]"
label reentry(foo=1):
"I'm conversing with [foo]."
return
label alternate_greeting(foo=1):
"Bonjour [foo]!"
call reentry(foo)
return |
I'd say even if it's legal, it's probably more likely to be an error than not. |
None of the labels in that example emit a lint warning, even if they were all reachable (which they are not, only |
My test code would be this : label entry:
label fine:
label finetoo():
label also(e=5):
label problem(f):
pass the |
Fair enough, I'm just always wary of lint accidentally becoming an opinionated "we don't think you want to do this" (weird label structuring) tool vs a "these are actual problems" (using attributes that don't exist) tool. |
I agree, I aimed for the second one. Note that this is a prototype to illustrate how the base issue can be solved and help consideration of that issue, I don't strongly support adding that check or that particular implementation. |
No description provided.