access subclass functions
Saaa
empty at needmail.com
Thu Nov 20 04:53:27 PST 2008
Is this not possible, or am I doing anything wrong?
Fruit[2] fruits; // Fruit has no peel function
fruit[0]= new Apple();
fruit[1]= new Banana(); //Banana has a protected peel() function returning a
bool
bool b;
b=fruit[1].peal();
Error: no property 'peel' for type 'project.fruitclass.Fruit'
Error: function expected before (), not 1 of type int
Error: cannot implicitly convert expression (cast(Banana)1()) of type
'project.banana.Banana' to bool
More information about the Digitalmars-d-learn
mailing list