summary refs log blame commit diff stats
path: root/tests/rodfiles/bmethods.nim
blob: 995942ad633b90bc7cf9c37930ca73e4a6661abb (plain) (tree)
1
2
           
                          


























                                         
discard """
  output: '''derived class
base class
'''
"""

import amethods


type
  TDerivedClass* = object of TBaseClass

proc newDerivedClass: ref TDerivedClass =
  new result
  
method echoType*(x: ref TDerivedClass) =
  echo "derived class"

var b, d: ref TBaseClass

b = newBaseClass()
d = newDerivedClass()

#b.echoType()
#d.echoType()

echoAlias d
echoAlias b