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

postfix:<++> strips mixins #4948

Closed
p6rt opened this issue Dec 27, 2015 · 5 comments
Closed

postfix:<++> strips mixins #4948

p6rt opened this issue Dec 27, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 27, 2015

Migrated from rt.perl.org#127050 (status was 'rejected')

Searchable as RT127050$

@p6rt
Copy link
Author

p6rt commented Dec 27, 2015

From @gfldex

role R { method Str() {'hidden!'} };
my $i = 1 but R;
sub f(\bound){ put bound };
f($i);
$i++;
f($i);

# OUTPUT«hidden!␤2␤»

@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

From @coke

On Sun Dec 27 15​:43​:56 2015, gfldex wrote​:

role R { method Str() {'hidden!'} };
my $i = 1 but R;
sub f(\bound){ put bound };
f($i);
$i++;
f($i);

# OUTPUT«hidden!␤2␤»

20​:45 < [Coke]> https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127050 - this
  appears to be a DIHWIDT - the role is applied to the literal 1,
  making a new object; when you ++ you're getting a new instance,
  a (fresh) 2. No?
20​:49 < jnthn> [Coke]​: It's correct behavior. The ticket is confused.
20​:49 < jnthn> (So yes, you're correct. :))
20​:50 < [Coke]> jnthn​: ok, I'll reject.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

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

@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

@coke - Status changed from 'open' to 'rejected'

@p6rt p6rt closed this as completed Jul 8, 2016
@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

From @coke

20​:51 < jnthn> Just to add a little, $i++ is taking the Scalar container $i and
  changing the value it references.
20​:51 < jnthn> And the role was, like you said, on the value 1, and now it
  contains the value 2.

--
Will "Coke" Coleda

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