The example says it all.
--
Matt Diephouse
~/Projects/parrot mdiep$ cat test.pir
.sub main :main
null $P0
multi($P0) # should print "Any\n"
.end
.sub multi :multi(String)
say "String"
.end
.sub multi :multi(_)
say "Any"
.end
~/Projects/parrot mdiep$ parrot test.pir
Null PMC access in type()
current instr.: 'main' pc 10 (test.pir:4)
~/Projects/parrot mdiep$
While that was never actually specced, I do consider a NULL PMC as something
like a null pointer in C. Any access (except testing for NULL-ness) to it is
an error. Above example tests, that some usage of a NULL PMC fails.
It's of course debatable, which usage of NULL should be allowed, e.g. above
one. An explicit test in PMC->type conversion for PMCNULL in the MMD code is
very likely all to make above code running (mmd.c:167,168).
my 2¢
leo
The above code prints "Any" in the mmd branch. Unless that's an
unwanted behavior, it looks like this ticket can be resolved once the
mmd branch is merged.
Added as a (passing) test in revision 31980.
Closing ticket.
--
Will "Coke" Coleda