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

^roles does not always list all of the roles #4449

Closed
p6rt opened this issue Jul 31, 2015 · 5 comments
Closed

^roles does not always list all of the roles #4449

p6rt opened this issue Jul 31, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jul 31, 2015

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

Searchable as RT125731$

@p6rt
Copy link
Author

p6rt commented Jul 31, 2015

From @AlexDaniel

Code​:
role A { };
role B does A { };
B.new.^roles.say;

Result​:
(B)

As skids points out, the expected result should be "(A) (B)" or "(B​::A)
(B)".

This bug was found by ChoHag. See IRC log​:
http://irclog.perlgeek.de/perl6/2015-07-31#i_10985350

@p6rt
Copy link
Author

p6rt commented Jul 31, 2015

From @AlexDaniel

Also see a follow-up discussion​:
http://irclog.perlgeek.de/perl6/2015-07-31#i_10986122

On Fri, Jul 31, 2015 at 11​:09 PM, perl6 via RT <perl6-bugs-followup@​perl.org

wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"^roles does not always list all of the roles",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​125731].

Please include the string​:

     \[perl #&#8203;125731\]

in the subject line of all future correspondence about this issue. To do
so,
you may reply to this message.

                    Thank you,
                    perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
Code​:
role A { };
role B does A { };
B.new.^roles.say;

Result​:
(B)

As skids points out, the expected result should be "(A) (B)" or "(B​::A)
(B)".

This bug was found by ChoHag. See IRC log​:
http://irclog.perlgeek.de/perl6/2015-07-31#i_10985350

@p6rt
Copy link
Author

p6rt commented Dec 11, 2015

From @jnthn

On Fri Jul 31 13​:09​:04 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
role A { };
role B does A { };
B.new.^roles.say;

Result​:
(B)

As skids points out, the expected result should be "(A) (B)" or "(B​::A)
(B)".

We used to, by default, give the non-transitive view of the done roles. I've now changed the default to give the (more commonly expected) flattened view, so now the example gives​:

((B) (A))

Discovered and fixed a bug in .^roles(​:transitive) too, while changing the default.

Tests covering this ticket, plus some new ones, in S12-introspection/roles.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Dec 11, 2015

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

@p6rt p6rt closed this as completed Dec 11, 2015
@p6rt
Copy link
Author

p6rt commented Dec 11, 2015

@jnthn - 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