Lets say one has A::Very::Shallow::ClassA and A::Very::Deep::ClassB
File: ./A/Very/Shallow/ClassA.pm6
class A::Very::Shallow::ClassA{
has Str $.label is rw;
has Str $.icon is rw;
has @.items is rw;
}
I want to inherit from ClassA in ClassB so I write:
File: ./A/Very/Deep/ClassB.pm6
class A::Very::Deep::ClassB is A::Very::Shallow::ClassA{
...
}
However that errors out with:
Cannot resolve caller trait_mod:<is>(A::Very::Deep::ClassB, A::Very::Shallow::ClassA, Hash); none of these signatures match:
(Mu:U $child, Mu:U $parent)
(Mu:U $child, :$DEPRECATED!)
(Mu:U $type, :$rw!)
(Mu:U $type, :$nativesize!)
(Mu:U $type, :$ctype!)
(Mu:U $type, :$unsigned!)
(Mu:U $type, :$hidden!)
(Mu:U $type, Mu :$array_type!)
(Mu:U $type, *%fail)
(Attribute:D $attr, |c is raw)
(Attribute:D $attr, :$rw!)
(Attribute:D $attr, :$readonly!)
(Attribute $attr, :$required!)
(Attribute $attr, Mu :$default!)
(Attribute:D $attr, :$box_target!)
...
I found plenty of documentation and examples on inheritance but none seem to cover what I would consider a simple an essential issue. I know the answer may be obvious but I am missing it at the moment.
What happens when the classes are in the same package as in
A::Money::Card is A::Money::Item
I am a bit baffled at the moment so any pointers would be great. Thank you in advance.