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

but-ing a Hash only works the last time ( (%(:42foo) but A) but B ) #1238

Open
AlexDaniel opened this issue Nov 6, 2017 · 1 comment
Open
Labels
regression Issue did not exist previously

Comments

@AlexDaniel
Copy link
Contributor

AlexDaniel commented Nov 6, 2017

Code:

role Foo { has $.a };
role Bar { has $.b };
say ((%(:66x, :67y) but Foo(5)) but Bar(7)).a

Result (2015.12,2016.01.1,2016.02):

5

Result (2016.03…2017.10,HEAD(ab03b54)):

Any

Bisectable points at (2016-03-14) 6b2b34a

.b always returns 7 (which is right) no matter what version of rakudo you use.

@AlexDaniel AlexDaniel added the regression Issue did not exist previously label Nov 6, 2017
jstuder-gh added a commit to jstuder-gh/rakudo that referenced this issue Nov 30, 2017
Addresses [Issue 1238](rakudo#1238).

This issue was occurring due to the an operation that takes place in the
Hash 'but' method. A cloning of the Hash obj occurs but not all the
attributes are being replicated in the clone.

Mirroring (almost) the logic of the Mu clone method so that all
attributes are replicated on the new clone obj, not just $!storage.
However, unlike in Mu, not cloning the $!storage Scalar container (the
.VAR on the attribute) to avoid causing a regression for the issue fixed
in commit 6b2b34a.
@ab5tract
Copy link
Collaborator

Returns (Any) for base and RakuAST:

> set-base; ./rakudo-m issues/r1238.raku
(Any)

> set-rakuast; ./rakudo-m issues/r1238.raku
(Any)

> ./rakudo-m -v
Welcome to Rakudo™ v2024.04-92-g24057e69c.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2024.04-6-g84121f0de.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

2 participants