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

.assuming on sub with is copy parameter fails #4684

Closed
p6rt opened this issue Oct 28, 2015 · 5 comments
Closed

.assuming on sub with is copy parameter fails #4684

p6rt opened this issue Oct 28, 2015 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 28, 2015

Migrated from rt.perl.org#126477 (status was 'open')

Searchable as RT126477$

@p6rt
Copy link
Author

p6rt commented Oct 28, 2015

From @gfldex

sub foo(@​a is copy, :$flag){ say @​a };
my @​a = 1,2;
(&foo.assuming(​:flag))(@​a);

# OUTPUT«replace this Array is copy logic␤ in sub __PRIMED_ANON at EVAL_2​:2␤ in sub __PRIMED_ANON at
EVAL_2​:1␤ in block <unit> at /tmp/TlcJQPUFbc​:1␤

@p6rt
Copy link
Author

p6rt commented Aug 11, 2016

From @coke

On Wed Oct 28 13​:40​:45 2015, gfldex wrote​:

sub foo(@​a is copy, :$flag){ say @​a };
my @​a = 1,2;
(&foo.assuming(​:flag))(@​a);

# OUTPUT«replace this Array is copy logic␤ in sub __PRIMED_ANON at
EVAL_2​:2␤ in sub __PRIMED_ANON at
EVAL_2​:1␤ in block <unit> at /tmp/TlcJQPUFbc​:1␤

Coming from​:

src/Perl6/Metamodel/BOOTSTRAP.nqp
435​: nqp​::die('replace this Array is copy logic');

Which is right below a

# XXX GLR

which appears 8 times in rakudo's src/ dir.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 11, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 15, 2017

From @skids

On Thu, 11 Aug 2016 09​:24​:31 -0700, coke wrote​:

On Wed Oct 28 13​:40​:45 2015, gfldex wrote​:

sub foo(@​a is copy, :$flag){ say @​a };
my @​a = 1,2;
(&foo.assuming(​:flag))(@​a);

# OUTPUT«replace this Array is copy logic␤ in sub __PRIMED_ANON at
EVAL_2​:2␤ in sub __PRIMED_ANON at
EVAL_2​:1␤ in block <unit> at /tmp/TlcJQPUFbc​:1␤

Coming from​:

src/Perl6/Metamodel/BOOTSTRAP.nqp
435​: nqp​::die('replace this Array is copy logic');

Which is right below a

# XXX GLR

which appears 8 times in rakudo's src/ dir.

Yeah this has nothing to do with .assuming. Any '@​ is copy' that hits the
slowpath binder will hit this. Currently a way to force hitting the slowpath binder
is to provide a named parameter with a lot of alternate names​:

$ perl6 -e 'sub foo(@​a is copy, :f(​:g(​:h(​:$i)))){ @​a }; my @​a = 1,2; &foo(@​a).say;'
replace this Array is copy logic
  in sub foo at -e line 1
  in block <unit> at -e line 1

It's just that many (all?) things that get munged through .assuming hit that binder.

@p6rt p6rt added the glr label Jan 5, 2020
@raiph
Copy link

raiph commented Mar 26, 2023

Fixed in 2022.02 Rakudo. (Pretty sure fixed since 2017.11.)

@raiph raiph closed this as completed Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants