|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re^3: Moose "unions" and inheritanceby tobyink (Prior) |
| on Nov 30, 2012 at 12:24 UTC ( #1006467=note: print w/ replies, xml ) | Need Help?? |
|
You see the problem? Making a type constraint tighter (e.g. if the parent class wants a Num, and the child class restricts it to an Int) should usually be just fine. Making it looser requires more caution. The author of the SecretAgent class needs to check which methods of Person assume that name is a string, and override them all.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||