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 call an 'our' sub in a role in Rakudo #2411

Closed
p6rt opened this issue Apr 17, 2011 · 5 comments
Closed

Can't call an 'our' sub in a role in Rakudo #2411

p6rt opened this issue Apr 17, 2011 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 17, 2011

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

Searchable as RT88750$

@p6rt
Copy link
Author

p6rt commented Apr 17, 2011

From @masak

<masak> rakudo​: role A { our sub foo { say "OH HAI" } }; A​::foo
<p6eval> rakudo 5ac05e​: OUTPUT«Cannot find sub A​::foo␤ in main
program body at line 1␤»
<masak> jnthn​: should that work?
<jnthn> mumble
* masak submits rakudobug
<jnthn> :)
<jnthn> I don't know, tbh.
<jnthn> I can argue it both ways.
<masak> me too.
<masak> but I wrote it by accident, and now that I'm thinking about
it, it doesn't seem so odd.
<jnthn> role A { our sub foo { say $?CLASS } } # ouch :)
<masak> well, yeah. but there will always be edge cases.
<jnthn> True
<masak> I can distinguish methods using the $obj.A​::foo syntax, so why
not subs using just A​::foo?

@p6rt
Copy link
Author

p6rt commented May 11, 2013

From @FROGGS

TimToady​: as far as I can see through my clouded branes, an our sub
oughta be okay just about anywhere, insofar as it's just a global
really. I wouldn't necessarily expect it to instantiate $?CLASS when
composed though.

@p6rt
Copy link
Author

p6rt commented May 11, 2013

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

@p6rt
Copy link
Author

p6rt commented Jul 30, 2015

From @jnthn

On Sun Apr 17 03​:17​:40 2011, masak wrote​:

<masak> rakudo​: role A { our sub foo { say "OH HAI" } }; A​::foo
<p6eval> rakudo 5ac05e​: OUTPUT«Cannot find sub A​::foo␤ in main
program body at line 1␤»
<masak> jnthn​: should that work?
<jnthn> mumble
* masak submits rakudobug

Now it's decided it won't be allowed, S14 is updated, and you get a compile time error. Test in S14-roles/namespaced.t.

@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