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

Can't access roles in roles in Rakudo #2492

Closed
p6rt opened this issue Oct 1, 2011 · 5 comments
Closed

Can't access roles in roles in Rakudo #2492

p6rt opened this issue Oct 1, 2011 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 1, 2011

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

Searchable as RT100468$

@p6rt
Copy link
Author

p6rt commented Oct 1, 2011

From @masak

<masak> nom​: class A { role B {} }; A​::B.new; say "alive"
<p6eval> nom ebd4d8​: OUTPUT«alive␤»
<masak> nom​: role A { role B {} }; A​::B.new; say "alive"
<p6eval> nom ebd4d8​: OUTPUT«Could not find symbol 'A​::&B' [...]
* masak submits rakudobug

So, defining the role B in a class enables us to refer to the role as
A​::B later, but defining the role in another role doesn't. There's
nothing in the spec to suggest there should be a difference here.

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

From @coke

On Sat Oct 01 02​:06​:07 2011, masak wrote​:

<masak> nom​: class A { role B {} }; A​::B.new; say "alive"
<p6eval> nom ebd4d8​: OUTPUT«alive␤»
<masak> nom​: role A { role B {} }; A​::B.new; say "alive"
<p6eval> nom ebd4d8​: OUTPUT«Could not find symbol 'A​::&B' [...]
* masak submits rakudobug

So, defining the role B in a class enables us to refer to the role as
A​::B later, but defining the role in another role doesn't. There's
nothing in the spec to suggest there should be a difference here.

Behavior unchanged as of 01/2014
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

From @jnthn

On Sat Oct 01 02​:06​:07 2011, masak wrote​:

<masak> nom​: class A { role B {} }; A​::B.new; say "alive"
<p6eval> nom ebd4d8​: OUTPUT«alive␤»
<masak> nom​: role A { role B {} }; A​::B.new; say "alive"
<p6eval> nom ebd4d8​: OUTPUT«Could not find symbol 'A​::&B' [...]
* masak submits rakudobug

So, defining the role B in a class enables us to refer to the role as
A​::B later, but defining the role in another role doesn't. There's
nothing in the spec to suggest there should be a difference here.

S14 now explains why there is a difference. We now disallow the latter declaration at compile time. Test coverage is in S14-roles/namespaced.t.

@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

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

@p6rt p6rt closed this as completed Jul 30, 2015
@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt added the Bug label Jan 5, 2020
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

1 participant