mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-03 20:44:46 +00:00
* fixes #20515; base requires explicit `{.gcsafe.}` to be GC-safe * add tests
This commit is contained in:
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())
|
||||
Reference in New Issue
Block a user