#1487: Object.find_method fails if PIR 'find_method' vtable override returns 
null
-----------------------------+----------------------------------------------
 Reporter:  Austin_Hastings  |       Owner:       
     Type:  bug              |      Status:  new  
 Priority:  normal           |   Milestone:       
Component:  none             |     Version:  2.1.0
 Severity:  medium           |    Keywords:       
     Lang:                   |       Patch:       
 Platform:                   |  
-----------------------------+----------------------------------------------

Comment(by Austin_Hastings):

 nqp-rx test case:
 {{{
 class Test {
         method Xfoo() { say("Xfoo!"); }

         method Xify($name) {
                 say("Looking for: $name");
                 my &sub := $name eq 'foo' ?? Test::Xfoo !! pir::null__P();
         }
 }

 INIT {
 P6metaclass.get_parrotclass(Test).add_vtable_override('find_method',
 Test::Xify);
 }

 my $obj := Test.new;
 $obj.foo;
 $obj.HOW;
 }}}
 outputs:
 {{{
 aus...@andlinux:~/kakapo$ parrot-nqp test.nqp
 Looking for: foo
 Xfoo!
 Looking for: HOW
 Method 'HOW' not found for invocant of class 'Test'
 current instr.: '_block11' pc 0 (EVAL_1:6)
 called from Sub 'parrot;PCT;HLLCompiler;eval' pc -1 ((unknown file):-1)
 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)
 }}}

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1487#comment:1>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to