mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
29 lines
314 B
Nim
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
|
|
|