stash = GvHV(gv) = newHV();
if (!HvNAME_get(stash))
+ {
hv_name_set(stash, nambeg, name_cursor - nambeg, 0);
+ /* If the containing stash has multiple effective
+ names, see that this one gets them, too. */
+ if (HvAUX(GvSTASH(gv))->xhv_name_count)
+ mro_package_moved(stash, NULL, gv, 1);
+ }
}
if (*name_cursor == ':')
use strict;
use warnings;
-plan(tests => 24);
+plan(tests => 27);
{
package New;
#
# This test assigns outer:: to clone::, making clone::inner an alias to
# outer::inner.
+#
+# Then we also run the test again, but without outer::inner
for(
{
name => 'assigning a glob to a glob',
"ok 1\nok 2\n",
{},
"replacing nonexistent nested packages by $$_{name} updates isa caches";
+
+ # Same test but with the subpackage autovivified after the assignment
+ fresh_perl_is
+ q~
+ @left::ISA = 'outer::inner';
+ @right::ISA = 'clone::inner';
+
+ __code__;
+
+ eval q{package outer::inner};
+
+ print "ok 1", "\n" if left->isa("clone::inner");
+ print "ok 2", "\n" if right->isa("outer::inner");
+ ~ =~ s\__code__\$$_{code}\r,
+ "ok 1\nok 2\n",
+ {},
+ "Giving nonexistent packages multiple effective names by $$_{name}";
}
no warnings; # temporary; there seems to be a scoping bug, as this does not