Constrained genericity: Difference between revisions

Content added Content deleted
m (Corrected a header typo.)
(→‎{{header|Ada}}: fix typo in source code)
Line 40: Line 40:
type Tomato is new Food with null record;
type Tomato is new Food with null record;
overriding procedure Eat (Object : in out Tomato) is null;
overriding procedure Eat (Object : in out Tomato) is null;
package Tomato_Box is new Tomato_Boxes (Tomato);
package Tomato_Box is new Food_Boxes (Tomato);
-- We have declared Banana and Tomato as a Food.
-- We have declared Banana and Tomato as a Food.
</lang>
</lang>