Ticket #1296 (closed bug: wontfix)
: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: |
Description
: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