mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-05 04:27:44 +00:00
28 lines
539 B
Nim
28 lines
539 B
Nim
discard """
|
|
cmd: "nim c -d:release $file"
|
|
output: '''correct method'''
|
|
"""
|
|
# bug #5439
|
|
type
|
|
Control* = ref object of RootObj
|
|
|
|
ControlImpl* = ref object of Control
|
|
|
|
Container* = ref object of ControlImpl
|
|
|
|
ContainerImpl* = ref object of Container
|
|
|
|
method testProc*(control: Control) {.base.} = echo "wrong method"
|
|
|
|
method testProc*(container: Container) = echo "correct method"
|
|
|
|
proc main()
|
|
|
|
main() # wrong method called
|
|
|
|
proc main() =
|
|
var container = new ContainerImpl
|
|
container.testProc()
|
|
|
|
# main() # correct method called
|