Ticket #1296 (closed bug: wontfix)

Opened 12 years ago

Last modified 12 years ago

:vtable is ignored when :anon

Reported by: Bram Geron <bgeron@…> Owned by:
Priority: normal Milestone:
Component: none Version:
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:


:vtable subs are not stored in the vtable slot of a namespace when :anon is set. This is because :anon blocks the sub from reaching the namespace:

src/global.c: (Parrot_store_sub_in_namespace) 613 else if (!(PObj_get_FLAGS(sub) & SUB_FLAG_PF_ANON)) { ... ... 617 Parrot_store_global_n(interp, ns, name, sub);

Parrot_store_global_n calls namespace->set_pmc_keyed_str, which also checks if subs are :anon, so the check in Parrot_store_sub_in_namespace seems to be unnecessary. If we remove it, :vtable :anon works.

This patch removes the check in Parrot_store_sub_in_namespace, and there's a test too. Created t/compilers/imcc/syn/sub.t for that.

src/global.c | 5 +++-- t/compilers/imcc/syn/sub.t | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-)

-- Bram Geron | GPG 0xE7B9E65E


vtableanon.patch Download (1.4 KB) - added by coke 12 years ago.

Change History

Changed 12 years ago by coke


  Changed 12 years ago by coke

follow-up: ↓ 3   Changed 12 years ago by coke

Comment on original ticket:

RT #53302 extends the meanings of various sub flags such that :vtable
now always implies :anon. As such, I think we can either apply this
patch or reject it, given that we expect a refactor of :vtable and
:method handling to occur at some point in the future.

Personally I'd suggest to reject it for now. Once possible workaround
might be to do

.sub "" :anon :vtable('get_integer')


in reply to: ↑ 2   Changed 12 years ago by coke

  • status changed from new to closed
  • resolution set to wontfix

As I was transferring this from RT, the original was rejected. See TT #389 for any followup.

Note: See TracTickets for help on using tickets.