Skip to content

Extra tests for array/list slices in scalar context #23481

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

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

richardleach
Copy link
Contributor

A small number of extra tests off the back of #23447.


  • This set of changes does not require a perldelta entry.

t/op/array.t Outdated
# GH #23447 - ensure that future optimizations don't break behaviour
{
my @x = "a" .. "d"; sub f {} my $y = @x[2, 3, f()];
is $y, d, 'Non-returning final sub element in array slice in scalar context';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not have "return" but it does return an empty list.

Maybe "Empty list returning final sub element..."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the changed text: "Trailing empty list return in..."?

Copy link
Contributor

@jkeenan jkeenan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concerns have been addressed. It's up to Tony now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants