petdance/scratch — Issue #250: P6metaclass.register does not catch second registration of PMC Class
Author: petdance
Created: 2011-11-01 05:41:48+00:00
State: open
Labels: bug, Pri-normal, Sev-medium

Registering a PMC class works. Registering the same class a second time does not produce a diagnostic - although attempting to register a non-PMC class twice does.
Also, the second register produces some horrible results.

{{{
main();

sub main() {
pir::load_bytecode('dumper.pbc');
pir::load_bytecode('P6object.pbc');
my $nsp;

$nsp := Q:PIR {
%r = get_hll_namespace ['Key']
};
_dumper($nsp);

P6metaclass.register('Key');

$nsp := Q:PIR {
%r = get_hll_namespace ['Key']
};
_dumper($nsp);

P6metaclass.register('Key');

$nsp := Q:PIR {
%r = get_hll_namespace ['Key']
};
_dumper($nsp);
}
}}}

Originally http://trac.parrot.org/parrot/ticket/1481