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 declare a role as the default value of a parameter in a parameterized role in Rakudo #2515

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

Comments

@p6rt
Copy link

p6rt commented Oct 15, 2011

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

Searchable as RT101426$

@p6rt
Copy link
Author

p6rt commented Oct 15, 2011

From @masak

<masak> nom​: role R[​::T = role Q[​::S = role { method baz { say "OH
HAI" } }] { method bar { S.baz } }] { method foo { T.bar } };
R.new.foo
<p6eval> nom d59f09​: OUTPUT«===SORRY!===␤Can only use get_who on a
SixModelObject␤»
<masak> b​: role R[​::T = role Q[​::S = role { method baz { say "OH HAI"
} }] { method bar { S.baz } }] { method foo { T.bar } }; R.new.foo
<p6eval> b 1b7dd1​: OUTPUT«OH HAI␤»
<jnthn> oh wow
<jnthn> It explodes in the weirdest place
<jnthn> Well, more silliest than anything.
<jnthn> masak​: Guess you wanna know what's going on. Well, we
encounter the package. We then go and start parsing its signature. At
that point a $*PACKAGE is introduced, but nothing is bound to it yet.
When declaring Q, which should be installed in it, the package is thus
missing.
<jnthn> And it's nasty to fix because we tend to like to have seen the
traits before we go and create the type object (which the package
hangs off).
<jnthn> Because we want to know what the repr will be.
<jnthn> I guess really though Q should not be declared inside R
<jnthn> (e.g. it's not R​::Q)
<jnthn> As we're in the signature.
<jnthn> Not in the body.
<masak> right.
<jnthn> spectesting a fix
<masak> \o/
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Oct 15, 2011

From @jnthn

On Sat Oct 15 15​:36​:36 2011, masak wrote​:

<masak> nom​: role R[​::T = role Q[​::S = role { method baz { say "OH
HAI" } }] { method bar { S.baz } }] { method foo { T.bar } };
R.new.foo
<p6eval> nom d59f09​: OUTPUT«===SORRY!===␤Can only use get_who on a
SixModelObject␤»
<masak> b​: role R[​::T = role Q[​::S = role { method baz { say "OH HAI"
} }] { method bar { S.baz } }] { method foo { T.bar } }; R.new.foo
<p6eval> b 1b7dd1​: OUTPUT«OH HAI␤»
<jnthn> oh wow
<jnthn> It explodes in the weirdest place
<jnthn> Well, more silliest than anything.
<jnthn> masak​: Guess you wanna know what's going on. Well, we
encounter the package. We then go and start parsing its signature. At
that point a $*PACKAGE is introduced, but nothing is bound to it yet.
When declaring Q, which should be installed in it, the package is thus
missing.
<jnthn> And it's nasty to fix because we tend to like to have seen the
traits before we go and create the type object (which the package
hangs off).
<jnthn> Because we want to know what the repr will be.
<jnthn> I guess really though Q should not be declared inside R
<jnthn> (e.g. it's not R​::Q)
<jnthn> As we're in the signature.
<jnthn> Not in the body.
<masak> right.
<jnthn> spectesting a fix
<masak> \o/
* masak submits rakudobug

The fix went in; needs tests.

/jnthn

@p6rt
Copy link
Author

p6rt commented Oct 15, 2011

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

@p6rt
Copy link
Author

p6rt commented May 4, 2012

From @moritz

now tested in S14-roles/parameterized-type.t

@p6rt
Copy link
Author

p6rt commented May 4, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant