Ticket #1520 (new bug)

Opened 5 years ago

P6metaclass cannot derive from already-`register`ed PMC type

Reported by: Austin_Hastings Owned by:
Priority: major Milestone:
Component: library Version: 2.2.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

Registering a PMC-proxy seems to be enough to prevent its use as a parent class.

austin@andLinux:~/kakapo$ cat test.nqp
INIT {
	P6metaclass.register('Hash');
}

class Foo is Hash {
	INIT { say("Hello, Foo"); }
}
austin@andLinux:~/kakapo$ parrot-nqp test.nqp
Could not build C3 linearization: ambiguous hierarchy
current instr.: 'parrot;P6metaclass;register' pc 532 (runtime/parrot/library/P6object.pir:408)
called from Sub '' pc -1 ((unknown file):-1)
called from Sub 'parrot;PCT;HLLCompiler;evalpmc' pc 972 (compilers/pct/src/PCT/HLLCompiler.pir:538)
... call repeated 1 times
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 388 (compilers/pct/src/PCT/HLLCompiler.pir:287)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 992 (compilers/pct/src/PCT/HLLCompiler.pir:556)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1303 (compilers/pct/src/PCT/HLLCompiler.pir:707)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1489 (compilers/pct/src/PCT/HLLCompiler.pir:794)
called from Sub 'parrot;NQP;Compiler;main' pc -1 ((unknown file):-1)

I suspect (based on scanning a trace, but not based on poring over the trace) that the problem lies in the get_parrotclass method.

The major impact for me is interoperation between the Kakapo library, which registers a large collection of PMC types, and the PCT/PGE tools, which build many of their classes as subtypes of Hash.

Note: See TracTickets for help on using tickets.