Skip to content
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

Failing tests in S06-traits/is-rw.t: %hash.pairs seems to make a copy rather than a reference #3931

Closed
p6rt opened this issue May 3, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented May 3, 2015

Migrated from rt.perl.org#124640 (status was 'resolved')

Searchable as RT124640$

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

This ticket is about tests in S06-traits/is-rw.t and S32-hash/pairs.t, which fail because iterating over %hash.pairs seems to work on a copy and not on a reference to the hash element​:

$ perl6 -e 'my %hash = (a => 42); for %hash.pairs -> $p { $p.value += 100 }; say %hash<a>'
42

The test expects 142 instead.

@p6rt
Copy link
Author

p6rt commented Jun 20, 2015

From @usev6

On Sat Jun 20 13​:15​:37 2015, bartolin@​gmx.de wrote​:

This ticket is about tests in S06-traits/is-rw.t and S32-hash/pairs.t,
which fail because iterating over %hash.pairs seems to work on a copy
and not on a reference to the hash element​:

$ perl6 -e 'my %hash = (a => 42); for %hash.pairs -> $p { $p.value +=
100 }; say %hash<a>'
42

The test expects 142 instead.

Actually it has nothing to do with the for loop​:

$ perl6 -e 'my %hash = (a => 42); %hash.pairs[0].value = 23; say %hash<a>'
42

@p6rt
Copy link
Author

p6rt commented Sep 19, 2015

From @niner

This was fixed by Rakudo commit 2232157​: Merge Enum into Pair.

perl6 -e 'my %hash = (a => 42); %hash.pairs[0].value = 23; say %hash<a>'
23

@p6rt p6rt closed this as completed Sep 19, 2015
@p6rt
Copy link
Author

p6rt commented Sep 19, 2015

@niner - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant