class Top def sum as int is virtual return 1 def product as int return 2 class Bottom inherits Top def sum as int is override return base.sum + 2 def product as int is override return base.product * 3 def main is shared b as Bottom = Bottom() assert b.sum==3 assert b.product==6