Files
Nim/tests/method/tmapper.nim
Aman Gupta 82a04051bb fix failure in tests/method/tmapper.nim
FAIL: tmapper.nim
Test "tests/method/tmapper.nim" in category "method"
Failure: reMsgsDiffer
Expected:
invalid declaration order; cannot attach 'step' to method defined here: tmapper.nim(22,7)
Gotten:
invalid declaration order; cannot attach 'step' to method defined here: tests/method/tmapper.nim(22,7)
2015-09-30 20:13:38 -07:00

31 lines
552 B
Nim

discard """
errormsg: "invalid declaration order; cannot attach 'step' to method defined here: tests/method/tmapper.nim(22,7)"
line: 25
"""
# bug #2590
type
Console* = ref object
mapper*: Mapper
Mapper* = ref object of RootObj
Mapper2* = ref object of Mapper
proc newMapper2*: Mapper2 =
new result
proc newMapper*: Mapper =
result = newMapper2()
method step*(m: Mapper2) {.base.} =
echo "Mapper2"
method step*(m: Mapper) {.base.} =
echo "Mapper"
var console = Console()
console.mapper = newMapper()
console.mapper.step()