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

Composing a role into the class does not concretify the type of an attribute #2646

Closed
p6rt opened this issue Feb 13, 2012 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Feb 13, 2012

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

Searchable as RT110556$

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

From @moritz

10​:00 < moritz> nom​: (2/3) but True
10​:00 <+p6eval> nom 6b1cba​: OUTPUT«Can not get non-existent attribute
  '$!numerator' on class '$?CLASS'␤ in block <anon> at
  /tmp/7qizKFLfFP​:1␤␤»
10​:01 < moritz> what the merge changed was that the attributes are now
declared in a role

...

10​:07 < jnthn> Oh. Only happens with but.
10​:09 < jnthn> nom​: role A { has $!a }; class B does A { }; A.new.clone()
10​:09 <+p6eval> nom 6b1cba​: OUTPUT«Can not get non-existent attribute
'$!a' on
  class '$?CLASS'␤ in block <anon> at /tmp/pJMnk5Pq1B​:1␤␤»
10​:09 < jnthn> Bingo.

10​:15 < moritz> nom​: role A { has $.a }; class B does A { }; for
B.^attributes
  { say $_; pir​::say pir​::typeof__SP($_.package) }
10​:15 <+p6eval> nom 6b1cba​: OUTPUT«$!a␤$?CLASS␤»
10​:15 < moritz> somehow the exception got eaten :(
10​:15 < jnthn> It's a type variable.
10​:15 < jnthn> And should complain loudly about being used

There's a failing test for that in t/spec/S14-roles/mixin.t

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

From @jnthn

On Mon Feb 13 01​:26​:00 2012, moritz wrote​:

10​:00 < moritz> nom​: (2/3) but True
10​:00 <+p6eval> nom 6b1cba​: OUTPUT«Can not get non-existent attribute
'$!numerator' on class '$?CLASS'␤ in block <anon> at
/tmp/7qizKFLfFP​:1␤␤»
10​:01 < moritz> what the merge changed was that the attributes are now
declared in a role

...

10​:07 < jnthn> Oh. Only happens with but.
10​:09 < jnthn> nom​: role A { has $!a }; class B does A { }; A.new.clone()
10​:09 <+p6eval> nom 6b1cba​: OUTPUT«Can not get non-existent attribute
'$!a' on
class '$?CLASS'␤ in block <anon> at /tmp/pJMnk5Pq1B​:1␤␤»
10​:09 < jnthn> Bingo.

10​:15 < moritz> nom​: role A { has $.a }; class B does A { }; for
B.^attributes
{ say $_; pir​::say pir​::typeof__SP($_.package) }
10​:15 <+p6eval> nom 6b1cba​: OUTPUT«$!a␤$?CLASS␤»
10​:15 < moritz> somehow the exception got eaten :(
10​:15 < jnthn> It's a type variable.
10​:15 < jnthn> And should complain loudly about being used

There's a failing test for that in t/spec/S14-roles/mixin.t

Fixed; that test is passing again, so resolving ticket.

/jnthn

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

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

@p6rt
Copy link
Author

p6rt commented Feb 13, 2012

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

@p6rt p6rt closed this as completed Feb 13, 2012
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