On 03.07.2014 13:04, Peter (via RT) wrote:
> # New Ticket Created by  Peter 
> # Please include the string:  [perl #122221]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=122221 >
> 
> 
> 23:29 psch    m: class A::B {...}; class A::C is A::B { method WHICH { say 
> "which" } }; class A::B { method inst { return A::C.new } }; my $a = 
> A::B.inst; $a.WHICH
> 23:29 camelia rakudo-moar b8a188: OUTPUT«Cannot invoke this object (REPR: 
> Null, cs = 0)␤  in method inst at /tmp/tOJLKN8zrC:1␤  in block  at 
> /tmp/tOJLKN8zrC:1␤␤»

I don't see how that could ever be made to work. At the time that the
child classes' closing bracket is parsed, the class is composed, which
mean its method table (including methods from superclasses) is calculated.

This means at the very least that if you inherit from a stubbed class,
you won't be able to call methods from the parent class.

So the best thing we can do is throw a better error message, at class
inheritance time.

Cheers,
Moritz

Reply via email to