Files
Nim/tests/ic/tmethods.nim
Andreas Rumpf 13b958eb45 IC: added basic test case for methods (#17679)
* IC: added basic test case for methods

* IC: better methods test
2021-04-09 06:59:25 +02:00

29 lines
314 B
Nim

discard """
output: '''Base abc'''
"""
import mbaseobj
var c = Base(s: "abc")
m c
#!EDIT!#
discard """
output: '''Base abc
Inherited abc'''
"""
import mbaseobj
type
Inherited = ref object of Base
method m(i: Inherited) =
procCall m(Base i)
echo "Inherited ", i.s
var c = Inherited(s: "abc")
m c