-
Notifications
You must be signed in to change notification settings - Fork 560
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
Void repeat propagates the calling context to its lhs #14174
Comments
From @cpansproutIf x with parentheses around the lhs occurs in void context, no matter where it occurs in a sub it will propagate the context in which the sub was called: $ ./perl -lIlib -e 'sub c { print qw[void scalar list][wantarray + defined wantarray] } sub f { (c())x(c()); print "---"; } f(); $_=f(); () = f() ' scalar list That’s *weird*. But what should it do? Internally, x falls back to scalar repeat when not in list context. (It doesn’t check explicitly for scalar context.) So scalar context here would make sense. (I suspect some instances of the void context result in stack bugs.) -- Father Chrysostomos |
From @cpansproutOn Mon Oct 20 20:21:28 2014, sprout wrote:
I was right about the stack bug, which I fixed a while ago in 3a100da. I have just fixed this bug for the most part in commit 1e2dd51, by applying scalar context to the lhs if the repetition is known to be in void context at compile time. At the end of a subroutine it still exhibits the buggy behaviour. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#123020 (status was 'open')
Searchable as RT123020$
The text was updated successfully, but these errors were encountered: