From 603c64c70d2354297b792a31bdc4a42e2be6f061 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Wed, 19 May 2010 14:08:00 +0200 Subject: [PATCH] fix RT #75180, accessors appear under wrong name in introspection --- src/metamodel/Attribute.nqp | 8 ++++++-- t/spectest.data | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/metamodel/Attribute.nqp b/src/metamodel/Attribute.nqp index 5ba35d5703c..755930dd4af 100644 --- a/src/metamodel/Attribute.nqp +++ b/src/metamodel/Attribute.nqp @@ -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... diff --git a/t/spectest.data b/t/spectest.data index cfda4b8ec6a..9bc1b669e56 100644 --- a/t/spectest.data +++ b/t/spectest.data @@ -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