* fixes #20515; base requires explicit `{.gcsafe.}` to be GC-safe * add tests
This commit is contained in:
parent
619d6c318c
commit
0bacdf5fdf
2 changed files with 32 additions and 4 deletions
20
tests/method/t20515.nim
Normal file
20
tests/method/t20515.nim
Normal file
|
|
@ -0,0 +1,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())
|
||||
Loading…
Add table
Add a link
Reference in a new issue