B extends A.
How to cast?
I tried myVectB as Vector.<A>. But got null.
override protected function getItems():Vector.<JBuyable>
{
return player.bonus as Vector.<JBuyable>; // null;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A banana is-a fruit. But a list of bananas is-not a list of fruit. Otherwise you could take your list of bananas, cast it to a list of fruit, and then add an apple.