Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type parentObj = object of RootObj
- type
- childObj1 = object of parentOBj
- childObj2 = object of parentOBj
- method whine(self: parentObj) =
- echo "Shutup!"
- method whine(self: childObj1) =
- echo "But.... mooooooooooooooooom"
- method whine(self: childObj2) =
- echo "But.... daaaaaaaaaaaaaaaaad"
- var myseq: seq[parentObj] = @[]
- myseq.add(childObj1())
- myseq.add(childObj2())
- for obj in myseq:
- obj.whine()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement