diff options
-rw-r--r-- | gv.c | 3 | ||||
-rw-r--r-- | t/mro/basic.t | 9 |
2 files changed, 11 insertions, 1 deletions
@@ -83,6 +83,9 @@ Perl_gv_add_by_type(pTHX_ GV *gv, svtype type) if (!*where) *where = newSV_type(type); + if (type == SVt_PVAV && GvNAMELEN(gv) == 3 + && strnEQ(GvNAME(gv), "ISA", 3)) + sv_magic(*where, (SV *)gv, PERL_MAGIC_isa, NULL, 0); return gv; } diff --git a/t/mro/basic.t b/t/mro/basic.t index e1a4dbfddb..188159e2fc 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -BEGIN { require q(./test.pl); } plan(tests => 53); +BEGIN { require q(./test.pl); } plan(tests => 54); require mro; @@ -338,3 +338,10 @@ is(eval { MRO_N->testfunc() }, 123); ok !Gwythaint->isa("Fantastic::Creature"), 'obliterating @ISA via glob assignment'; } + +{ + # Autovivifying @ISA via @{*ISA} + undef *fednu::ISA; + @{*fednu::ISA} = "pyfg"; + ok +fednu->isa("pyfg"), 'autovivifying @ISA via *{@ISA}'; +} |