If a METHOD is defined in a *.pmc file, that METHOD is not
automatically inherited by PIR-based subclasses.
$ cat zzz.pir
.sub main :main
$P0 = new 'String'
$P0 = 'Hello'
$P0.'replace'('e', 'a')
say $P0
$P99 = subclass 'String', 'Foo'
$P1 = new 'Foo'
$P1 = 'Hello'
$P1.'replace'('e', 'a')
say $P1
.end
$ ./parrot zzz.pir
Hallo
Segmentation fault
$
Pm
This isn't quite true. But some METHODs / vtables / MMDs are implemented in a
way that doesn't cope with inheritance.
See also:
#39329: Check to make sure PMC_str_val, etc. are used appropriately
or:
src/pmc/integer.pmc:
...
PMC* add (PMC* value, PMC* dest) {
MMD_Integer: {
/*
* SELF and value can both be PMCs that inherit
* from Integer:
* cl = subclass "Integer", "MyInt"
* so we can't used PMC_int_val(SELF) in any of these
* Integer methods
leo