summary refs log tree commit diff stats
path: root/tests/method/t20515.nim
blob: 1921f2e46afe44ff0f07a6b3f1e8474baca3d590 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  errormsg: "Base method 'zzz' requires explicit '{.gcsafe.}' to be GC-safe"
  line: 10
"""

type
  A = ref object of RootObj
  B = ref object of A

method zzz(a: A) {.base.} =
  discard

var s: seq[int]
method zzz(a: B) =
  echo s

proc xxx(someObj: A) {.gcsafe.} =
  someObj.zzz()

xxx(B())