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
state stub doesn't get init-once behaviour #16221
Comments
From zefram@fysh.orgCreated by zefram@fysh.org$ perl -Mfeature=state -lwe '$i = 0; sub f { state() = $i++; 1; } f(); f(); print $i' "state()" is a state variable declaration of a list of no variables. But worse than it being accepted, it's accepted with the wrong semantics. What's going on is that "state()" yields a bare "stub" op, with no flag Perl Info
|
From zefram@fysh.orgAdditional: the same thing happens with "state(undef)", "state(undef, $ perl -Mfeature=state -lwe '$i = 0; sub f { state(undef) = $i++; 1; } f(); f(); print $i' "state(undef)" compiles to an "undef" op, just like "(undef)". -zefram |
Migrated from rt.perl.org#132394 (status was 'new')
Searchable as RT132394$
The text was updated successfully, but these errors were encountered: