Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add caveats re: aliased not working for roles (yet)
  • Loading branch information
cjfields committed Sep 8, 2014
1 parent 572e975 commit f3ac538
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Bio/Role/Aliased.pm6
Expand Up @@ -6,6 +6,9 @@ role Bio::Role::Aliased;
multi trait_mod:<is>(Attribute:D $attr, :$aliased!) is export {
my $accessor_name = $attr.name.substr(2);

say $attr.package.HOW;

# TODO: this only works for class declarations and not roles
for $aliased.list -> $name {
$attr.package.HOW.add_method($attr.HOW, $name, method {
self."$accessor_name"()
Expand Down
7 changes: 6 additions & 1 deletion lib/Bio/Role/Describable.pm6
@@ -1,10 +1,15 @@
use v6;

use Bio::Role::Aliased;

role Bio::Role::Describable;

has Str $.display_name is rw = 'new-id';
has Str $.description is rw;
#best way would to have aliased working again - takadonet

# TODO: best way would to have aliased working again - takadonet
# Working again but not on roles

#has Str $.description is rw is aliased<desc>;

method desc ($desc?) {
Expand Down

0 comments on commit f3ac538

Please sign in to comment.