Navigation Menu

Skip to content

Commit

Permalink
fix RT #75180, accessors appear under wrong name in introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed May 19, 2010
1 parent 3a694dd commit 603c64c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/metamodel/Attribute.nqp
Expand Up @@ -56,13 +56,17 @@ method compose($package) {
pir::new__PsP('Perl6Scalar', pir::getattribute__PPS($self, $name))
}
sub accessor_helper_rw($self) {
pir::getattribute__PPS($self, $name)
pir::getattribute__PPS($self, $name)
}

# XXX check there isn't already one...
my $meth := $!rw ?? pir::find_lex__Ps('accessor_helper_rw') !! pir::find_lex__Ps('accessor_helper_ro');
my $meth_name := pir::substr__SSi($name, 2);
$package.add_method($package, $meth_name, pir::clone__PP($meth));
$meth := pir::clone__PP($meth);
# introspection looks at the actual sub name, so set it
# to the value the user expects
pir::set__vps($meth, $meth_name);
$package.add_method($package, $meth_name, $meth);
}

# XXX Handles...
Expand Down
1 change: 1 addition & 0 deletions t/spectest.data
Expand Up @@ -29,6 +29,7 @@ integration/advent2009-day03.t
integration/advent2009-day04.t
integration/advent2009-day05.t
integration/advent2009-day06.t
integration/advent2009-day11.t
integration/code-blocks-as-sub-args.t
integration/lexical-array-in-inner-block.t
integration/lexicals-and-attributes.t
Expand Down

0 comments on commit 603c64c

Please sign in to comment.