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

subclasses of class augmented with role don't match the role #5131

Closed
p6rt opened this issue Feb 11, 2016 · 4 comments
Closed

subclasses of class augmented with role don't match the role #5131

p6rt opened this issue Feb 11, 2016 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Feb 11, 2016

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

Searchable as RT127520$

@p6rt
Copy link
Author

p6rt commented Feb 11, 2016

From @LLFourn

use MONKEY-TYPING;
role R {};
augment class Str does R {};

say Str ~~ R; # True
say IntStr ~~ Str; #True
say IntStr ~~ R; #False

@p6rt
Copy link
Author

p6rt commented Jul 22, 2016

From @zoffixznet

Thanks for the report.

To have IntStr take effect of the modifications, you need to recompose it. The same applies to stuff like adding methods too.

zoffix@​VirtualBox​:~/CPANPRC$ cat test.p6
use MONKEY-TYPING;
role R {};
augment class Str does R {};
IntStr.^compose;
say IntStr ~~ R;

zoffix@​VirtualBox​:~/CPANPRC$ perl6 test.p6
True

--
Cheers,
ZZ | https://twitter.com/zoffix

@p6rt
Copy link
Author

p6rt commented Jul 22, 2016

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

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

p6rt commented Jul 22, 2016

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

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